| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 3030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3041 const int length = 5; | 3041 const int length = 5; |
| 3042 text = frame->contentAsText(length); | 3042 text = frame->contentAsText(length); |
| 3043 EXPECT_EQ(expected.substr(0, length), text.utf8()); | 3043 EXPECT_EQ(expected.substr(0, length), text.utf8()); |
| 3044 | 3044 |
| 3045 // Now do a new test with a subframe. | 3045 // Now do a new test with a subframe. |
| 3046 const char outerFrameSource[] = "Hello<iframe></iframe> world"; | 3046 const char outerFrameSource[] = "Hello<iframe></iframe> world"; |
| 3047 frame->loadHTMLString(outerFrameSource, testURL); | 3047 frame->loadHTMLString(outerFrameSource, testURL); |
| 3048 runPendingTasks(); | 3048 runPendingTasks(); |
| 3049 | 3049 |
| 3050 // Load something into the subframe. | 3050 // Load something into the subframe. |
| 3051 WebFrame* subframe = frame->findChildByExpression(WebString::fromUTF8("/html
/body/iframe")); | 3051 WebFrame* subframe = frame->firstChild(); |
| 3052 ASSERT_TRUE(subframe); | 3052 ASSERT_TRUE(subframe); |
| 3053 subframe->loadHTMLString("sub<p>text", testURL); | 3053 subframe->loadHTMLString("sub<p>text", testURL); |
| 3054 runPendingTasks(); | 3054 runPendingTasks(); |
| 3055 | 3055 |
| 3056 text = frame->contentAsText(std::numeric_limits<size_t>::max()); | 3056 text = frame->contentAsText(std::numeric_limits<size_t>::max()); |
| 3057 EXPECT_EQ("Hello world\n\nsub\ntext", text.utf8()); | 3057 EXPECT_EQ("Hello world\n\nsub\ntext", text.utf8()); |
| 3058 | 3058 |
| 3059 // Get the frame text where the subframe separator falls on the boundary of | 3059 // Get the frame text where the subframe separator falls on the boundary of |
| 3060 // what we'll take. There used to be a crash in this case. | 3060 // what we'll take. There used to be a crash in this case. |
| 3061 text = frame->contentAsText(12); | 3061 text = frame->contentAsText(12); |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3531 WebFrame* frame; | 3531 WebFrame* frame; |
| 3532 WebRect startWebRect; | 3532 WebRect startWebRect; |
| 3533 WebRect endWebRect; | 3533 WebRect endWebRect; |
| 3534 | 3534 |
| 3535 registerMockedHttpURLLoad("select_range_iframe.html"); | 3535 registerMockedHttpURLLoad("select_range_iframe.html"); |
| 3536 registerMockedHttpURLLoad("select_range_basic.html"); | 3536 registerMockedHttpURLLoad("select_range_basic.html"); |
| 3537 | 3537 |
| 3538 FrameTestHelpers::WebViewHelper webViewHelper; | 3538 FrameTestHelpers::WebViewHelper webViewHelper; |
| 3539 initializeTextSelectionWebView(m_baseURL + "select_range_iframe.html", &webV
iewHelper); | 3539 initializeTextSelectionWebView(m_baseURL + "select_range_iframe.html", &webV
iewHelper); |
| 3540 frame = webViewHelper.webView()->mainFrame(); | 3540 frame = webViewHelper.webView()->mainFrame(); |
| 3541 WebFrame* subframe = frame->findChildByExpression(WebString::fromUTF8("/html
/body/iframe")); | 3541 WebFrame* subframe = frame->firstChild(); |
| 3542 EXPECT_EQ("Some test text for testing.", selectionAsString(subframe)); | 3542 EXPECT_EQ("Some test text for testing.", selectionAsString(subframe)); |
| 3543 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect); | 3543 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect); |
| 3544 subframe->executeCommand(WebString::fromUTF8("Unselect")); | 3544 subframe->executeCommand(WebString::fromUTF8("Unselect")); |
| 3545 EXPECT_EQ("", selectionAsString(subframe)); | 3545 EXPECT_EQ("", selectionAsString(subframe)); |
| 3546 subframe->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect)
); | 3546 subframe->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect)
); |
| 3547 EXPECT_EQ("Some test text for testing.", selectionAsString(subframe)); | 3547 EXPECT_EQ("Some test text for testing.", selectionAsString(subframe)); |
| 3548 } | 3548 } |
| 3549 | 3549 |
| 3550 TEST_F(WebFrameTest, SelectRangeDivContentEditable) | 3550 TEST_F(WebFrameTest, SelectRangeDivContentEditable) |
| 3551 { | 3551 { |
| (...skipping 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5389 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); | 5389 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); |
| 5390 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA
nonymous)); | 5390 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA
nonymous)); |
| 5391 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir
ectChild)); | 5391 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir
ectChild)); |
| 5392 | 5392 |
| 5393 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB
lock(); | 5393 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB
lock(); |
| 5394 EXPECT_TRUE(anonymousBlock->isAnonymous()); | 5394 EXPECT_TRUE(anonymousBlock->isAnonymous()); |
| 5395 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); | 5395 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); |
| 5396 } | 5396 } |
| 5397 | 5397 |
| 5398 } // namespace | 5398 } // namespace |
| OLD | NEW |