Changeset 161478 in webkit


Ignore:
Timestamp:
Jan 7, 2014 6:41:59 PM (10 years ago)
Author:
jinwoo7.song@samsung.com
Message:

[EFL][WK2] Fix failing ewk_view_page_contents_get() API test
https://bugs.webkit.org/show_bug.cgi?id=126609

Reviewed by Gyuyoung Kim.

Compare the amount of bytes in the expected result file with
the size of callback data from the API since the 'Date' field
and the boundaries will be different on each case.
Refered the test case of GTK port.

  • UIProcess/API/efl/tests/resources/resultMHTML.mht: Added.
  • UIProcess/API/efl/tests/test_ewk2_view.cpp:

(EWK2ViewTest::PageContentsAsMHTMLCallback):

Location:
trunk/Source/WebKit2
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r161477 r161478  
     12014-01-07  Jinwoo Song  <jinwoo7.song@samsung.com>
     2
     3        [EFL][WK2] Fix failing ewk_view_page_contents_get() API test
     4        https://bugs.webkit.org/show_bug.cgi?id=126609
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Compare the amount of bytes in the expected result file with
     9        the size of callback data from the API since the 'Date' field
     10        and the boundaries will be different on each case.
     11        Refered the test case of GTK port.
     12
     13        * UIProcess/API/efl/tests/resources/resultMHTML.mht: Added.
     14        * UIProcess/API/efl/tests/test_ewk2_view.cpp:
     15        (EWK2ViewTest::PageContentsAsMHTMLCallback):
     16
    1172014-01-07  Seokju Kwon  <seokju@webkit.org>
    218
  • trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp

    r161257 r161478  
    211211        ASSERT_EQ(EWK_PAGE_CONTENTS_TYPE_MHTML, type);
    212212
    213         // The variable data should have below text block.
    214         const String expectedMHTML = "\r\n\r\n<=00h=00t=00m=00l=00>=00<=00h=00e=00a=00d=00>=00<=00m=00e=00t=00a=00 =00c=\r\n"
    215             "=00h=00a=00r=00s=00e=00t=00=3D=00\"=00U=00T=00F=00-=001=006=00L=00E=00\"=00>=\r\n"
    216             "=00<=00/=00h=00e=00a=00d=00>=00<=00b=00o=00d=00y=00>=00<=00p=00>=00S=00i=00=\r\n"
    217             "m=00p=00l=00e=00 =00H=00T=00M=00L=00<=00/=00p=00>=00<=00/=00b=00o=00d=00y=\r\n"
    218             "=00>=00<=00/=00h=00t=00m=00l=00>=00\r\n";
    219 
    220         ASSERT_TRUE(String(data).contains(expectedMHTML));
     213        // We should have exactly the same amount of bytes in the file
     214        // than those coming from the callback data. We don't compare the
     215        // strings read since the 'Date' field and the boundaries will be
     216        // different on each case. MHTML functionality will be tested by
     217        // layout tests, so checking the amount of bytes is enough.
     218        Eina_File* f = eina_file_open(TEST_RESOURCES_DIR "/resultMHTML.mht", false);
     219        if (!f)
     220            return;
     221
     222        size_t fileSize = eina_file_size_get(f);
     223        EXPECT_EQ(fileSize, String(data).length());
    221224
    222225        obtainedPageContents = true;
     226        eina_file_close(f);
    223227    }
    224228
Note: See TracChangeset for help on using the changeset viewer.