diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-22 13:36:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-22 13:36:28 +0200 |
commit | c311cf639cc1d6570d67b0a80a8ba04dc992a658 (patch) | |
tree | 6e16fefc7ece11ce4ec1e475a58a537a7acebaf8 /Source/WebKit/chromium/tests/WebFrameTest.cpp | |
parent | 5ef7c8a6a70875d4430752d146bdcb069605d71d (diff) | |
download | qtwebkit-c311cf639cc1d6570d67b0a80a8ba04dc992a658.tar.gz |
Imported WebKit commit 35255d8c2fd37ba4359e75fe0ebe6aec87687f9c (http://svn.webkit.org/repository/webkit/trunk@126284)
New snapshot that includes MSVC 64-bit build fix
Diffstat (limited to 'Source/WebKit/chromium/tests/WebFrameTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/WebFrameTest.cpp | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp index 8fc74988e..03c201e16 100644 --- a/Source/WebKit/chromium/tests/WebFrameTest.cpp +++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp @@ -891,7 +891,7 @@ TEST_F(WebFrameTest, FindInPageMatchRects) static const char* kFindString = "result"; static const int kFindIdentifier = 12345; - static const int kNumResults = 10; + static const int kNumResults = 16; WebFindOptions options; WebString searchText = WebString::fromUTF8(kFindString); @@ -918,8 +918,8 @@ TEST_F(WebFrameTest, FindInPageMatchRects) // Check that the find result ordering matches with our expectations. Range* result = mainFrame->activeMatchFrame()->activeMatch(); ASSERT_TRUE(result); - result->setEnd(result->endContainer(), result->endOffset() + 2); - EXPECT_EQ(result->text(), String::format("%s %d", kFindString, resultIndex)); + result->setEnd(result->endContainer(), result->endOffset() + 3); + EXPECT_EQ(result->text(), String::format("%s %02d", kFindString, resultIndex)); // Verify that the expected match rect also matches the currently active match. // Compare the enclosing rects to prevent precision issues caused by CSS transforms. @@ -950,6 +950,36 @@ TEST_F(WebFrameTest, FindInPageMatchRects) EXPECT_TRUE(webMatchRects[7].y < webMatchRects[8].y); EXPECT_TRUE(webMatchRects[8].y < webMatchRects[9].y); + // Results 11, 12, 13 and 14 should be between results 10 and 15, as they are inside the table. + EXPECT_TRUE(webMatchRects[11].y > webMatchRects[10].y); + EXPECT_TRUE(webMatchRects[12].y > webMatchRects[10].y); + EXPECT_TRUE(webMatchRects[13].y > webMatchRects[10].y); + EXPECT_TRUE(webMatchRects[14].y > webMatchRects[10].y); + EXPECT_TRUE(webMatchRects[11].y < webMatchRects[15].y); + EXPECT_TRUE(webMatchRects[12].y < webMatchRects[15].y); + EXPECT_TRUE(webMatchRects[13].y < webMatchRects[15].y); + EXPECT_TRUE(webMatchRects[14].y < webMatchRects[15].y); + + // Result 11 should be above 12, 13 and 14 as it's in the table header. + EXPECT_TRUE(webMatchRects[11].y < webMatchRects[12].y); + EXPECT_TRUE(webMatchRects[11].y < webMatchRects[13].y); + EXPECT_TRUE(webMatchRects[11].y < webMatchRects[14].y); + + // Result 11 should also be right to 12, 13 and 14 because of the colspan. + EXPECT_TRUE(webMatchRects[11].x > webMatchRects[12].x); + EXPECT_TRUE(webMatchRects[11].x > webMatchRects[13].x); + EXPECT_TRUE(webMatchRects[11].x > webMatchRects[14].x); + + // Result 12 should be left to results 11, 13 and 14 in the table layout. + EXPECT_TRUE(webMatchRects[12].x < webMatchRects[11].x); + EXPECT_TRUE(webMatchRects[12].x < webMatchRects[13].x); + EXPECT_TRUE(webMatchRects[12].x < webMatchRects[14].x); + + // Results 13, 12 and 14 should be one above the other in that order because of the rowspan + // and vertical-align: middle by default. + EXPECT_TRUE(webMatchRects[13].y < webMatchRects[12].y); + EXPECT_TRUE(webMatchRects[12].y < webMatchRects[14].y); + // Resizing should update the rects version. webView->resize(WebSize(800, 600)); webkit_support::RunAllPendingMessages(); |