| 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 { | 318 { |
| 319 registerMockedHttpURLLoad("iframes_test.html"); | 319 registerMockedHttpURLLoad("iframes_test.html"); |
| 320 registerMockedHttpURLLoad("visible_iframe.html"); | 320 registerMockedHttpURLLoad("visible_iframe.html"); |
| 321 registerMockedHttpURLLoad("invisible_iframe.html"); | 321 registerMockedHttpURLLoad("invisible_iframe.html"); |
| 322 registerMockedHttpURLLoad("zero_sized_iframe.html"); | 322 registerMockedHttpURLLoad("zero_sized_iframe.html"); |
| 323 | 323 |
| 324 FrameTestHelpers::WebViewHelper webViewHelper(this); | 324 FrameTestHelpers::WebViewHelper webViewHelper(this); |
| 325 webViewHelper.initializeAndLoad(m_baseURL + "iframes_test.html"); | 325 webViewHelper.initializeAndLoad(m_baseURL + "iframes_test.html"); |
| 326 | 326 |
| 327 // Now retrieve the frames text and test it only includes visible elements. | 327 // Now retrieve the frames text and test it only includes visible elements. |
| 328 webViewHelper.webView()->updateAllLifecyclePhases(); | |
| 329 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webViewHelp
er.webView()->mainFrame()->toWebLocalFrame(), 1024).utf8(); | 328 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webViewHelp
er.webView()->mainFrame()->toWebLocalFrame(), 1024).utf8(); |
| 330 EXPECT_NE(std::string::npos, content.find(" visible paragraph")); | 329 EXPECT_NE(std::string::npos, content.find(" visible paragraph")); |
| 331 EXPECT_NE(std::string::npos, content.find(" visible iframe")); | 330 EXPECT_NE(std::string::npos, content.find(" visible iframe")); |
| 332 EXPECT_EQ(std::string::npos, content.find(" invisible pararaph")); | 331 EXPECT_EQ(std::string::npos, content.find(" invisible pararaph")); |
| 333 EXPECT_EQ(std::string::npos, content.find(" invisible iframe")); | 332 EXPECT_EQ(std::string::npos, content.find(" invisible iframe")); |
| 334 EXPECT_EQ(std::string::npos, content.find("iframe with zero size")); | 333 EXPECT_EQ(std::string::npos, content.find("iframe with zero size")); |
| 335 } | 334 } |
| 336 | 335 |
| 337 TEST_P(ParameterizedWebFrameTest, FrameForEnteredContext) | 336 TEST_P(ParameterizedWebFrameTest, FrameForEnteredContext) |
| 338 { | 337 { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 FrameTestHelpers::WebViewHelper webViewHelper(this); | 491 FrameTestHelpers::WebViewHelper webViewHelper(this); |
| 493 | 492 |
| 494 /// Pass true to enable JavaScript. | 493 /// Pass true to enable JavaScript. |
| 495 webViewHelper.initializeAndLoad(m_baseURL + fileName, true); | 494 webViewHelper.initializeAndLoad(m_baseURL + fileName, true); |
| 496 | 495 |
| 497 // Setting host to "hostname:" should be treated as "hostname:0". | 496 // Setting host to "hostname:" should be treated as "hostname:0". |
| 498 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), "javascrip
t:location.host = 'internal.test:'; void 0;"); | 497 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), "javascrip
t:location.host = 'internal.test:'; void 0;"); |
| 499 | 498 |
| 500 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), "javascrip
t:document.body.textContent = location.href; void 0;"); | 499 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), "javascrip
t:document.body.textContent = location.href; void 0;"); |
| 501 | 500 |
| 502 webViewHelper.webView()->updateAllLifecyclePhases(); | |
| 503 | |
| 504 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webViewHelp
er.webView()->mainFrame()->toWebLocalFrame(), 1024).utf8(); | 501 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webViewHelp
er.webView()->mainFrame()->toWebLocalFrame(), 1024).utf8(); |
| 505 EXPECT_EQ("http://internal.test:0/" + fileName, content); | 502 EXPECT_EQ("http://internal.test:0/" + fileName, content); |
| 506 } | 503 } |
| 507 | 504 |
| 508 TEST_P(ParameterizedWebFrameTest, LocationSetEmptyPort) | 505 TEST_P(ParameterizedWebFrameTest, LocationSetEmptyPort) |
| 509 { | 506 { |
| 510 std::string fileName = "print-location-href.html"; | 507 std::string fileName = "print-location-href.html"; |
| 511 registerMockedHttpURLLoad(fileName); | 508 registerMockedHttpURLLoad(fileName); |
| 512 URLTestHelpers::registerMockedURLLoad(toKURL("http://internal.test:0/" + fil
eName), WebString::fromUTF8(fileName)); | 509 URLTestHelpers::registerMockedURLLoad(toKURL("http://internal.test:0/" + fil
eName), WebString::fromUTF8(fileName)); |
| 513 | 510 |
| 514 FrameTestHelpers::WebViewHelper webViewHelper(this); | 511 FrameTestHelpers::WebViewHelper webViewHelper(this); |
| 515 | 512 |
| 516 /// Pass true to enable JavaScript. | 513 /// Pass true to enable JavaScript. |
| 517 webViewHelper.initializeAndLoad(m_baseURL + fileName, true); | 514 webViewHelper.initializeAndLoad(m_baseURL + fileName, true); |
| 518 | 515 |
| 519 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), "javascrip
t:location.port = ''; void 0;"); | 516 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), "javascrip
t:location.port = ''; void 0;"); |
| 520 | 517 |
| 521 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), "javascrip
t:document.body.textContent = location.href; void 0;"); | 518 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), "javascrip
t:document.body.textContent = location.href; void 0;"); |
| 522 | 519 |
| 523 webViewHelper.webView()->updateAllLifecyclePhases(); | |
| 524 | |
| 525 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webViewHelp
er.webView()->mainFrame()->toWebLocalFrame(), 1024).utf8(); | 520 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webViewHelp
er.webView()->mainFrame()->toWebLocalFrame(), 1024).utf8(); |
| 526 EXPECT_EQ("http://internal.test:0/" + fileName, content); | 521 EXPECT_EQ("http://internal.test:0/" + fileName, content); |
| 527 } | 522 } |
| 528 | 523 |
| 529 class EvaluateOnLoadWebFrameClient : public FrameTestHelpers::TestWebFrameClient
{ | 524 class EvaluateOnLoadWebFrameClient : public FrameTestHelpers::TestWebFrameClient
{ |
| 530 public: | 525 public: |
| 531 EvaluateOnLoadWebFrameClient() : m_executing(false), m_wasExecuted(false) {
} | 526 EvaluateOnLoadWebFrameClient() : m_executing(false), m_wasExecuted(false) {
} |
| 532 | 527 |
| 533 void didClearWindowObject(WebLocalFrame* frame) override | 528 void didClearWindowObject(WebLocalFrame* frame) override |
| 534 { | 529 { |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 | 1028 |
| 1034 EXPECT_EQ(2, webViewHelper.webViewImpl()->page()->deviceScaleFactor()); | 1029 EXPECT_EQ(2, webViewHelper.webViewImpl()->page()->deviceScaleFactor()); |
| 1035 | 1030 |
| 1036 // Device scale factor should be independent of page scale. | 1031 // Device scale factor should be independent of page scale. |
| 1037 webViewHelper.webView()->setDefaultPageScaleLimits(1, 2); | 1032 webViewHelper.webView()->setDefaultPageScaleLimits(1, 2); |
| 1038 webViewHelper.webView()->setPageScaleFactor(0.5); | 1033 webViewHelper.webView()->setPageScaleFactor(0.5); |
| 1039 webViewHelper.webView()->updateAllLifecyclePhases(); | 1034 webViewHelper.webView()->updateAllLifecyclePhases(); |
| 1040 EXPECT_EQ(1, webViewHelper.webView()->pageScaleFactor()); | 1035 EXPECT_EQ(1, webViewHelper.webView()->pageScaleFactor()); |
| 1041 | 1036 |
| 1042 // Force the layout to happen before leaving the test. | 1037 // Force the layout to happen before leaving the test. |
| 1043 webViewHelper.webView()->updateAllLifecyclePhases(); | 1038 WebFrameContentDumper::dumpFrameTreeAsText(webViewHelper.webView()->mainFram
e()->toWebLocalFrame(), 1024).utf8(); |
| 1044 } | 1039 } |
| 1045 | 1040 |
| 1046 TEST_P(ParameterizedWebFrameTest, FixedLayoutInitializeAtMinimumScale) | 1041 TEST_P(ParameterizedWebFrameTest, FixedLayoutInitializeAtMinimumScale) |
| 1047 { | 1042 { |
| 1048 registerMockedHttpURLLoad("fixed_layout.html"); | 1043 registerMockedHttpURLLoad("fixed_layout.html"); |
| 1049 | 1044 |
| 1050 FixedLayoutTestWebViewClient client; | 1045 FixedLayoutTestWebViewClient client; |
| 1051 client.m_screenInfo.deviceScaleFactor = 1; | 1046 client.m_screenInfo.deviceScaleFactor = 1; |
| 1052 int viewportWidth = 640; | 1047 int viewportWidth = 640; |
| 1053 int viewportHeight = 480; | 1048 int viewportHeight = 480; |
| (...skipping 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3607 webViewHelper.resize(WebSize(640, 480)); | 3602 webViewHelper.resize(WebSize(640, 480)); |
| 3608 WebFrame* frame = webViewHelper.webView()->mainFrame(); | 3603 WebFrame* frame = webViewHelper.webView()->mainFrame(); |
| 3609 | 3604 |
| 3610 // Generate a simple test case. | 3605 // Generate a simple test case. |
| 3611 const char simpleSource[] = "<div>Foo bar</div><div></div>baz"; | 3606 const char simpleSource[] = "<div>Foo bar</div><div></div>baz"; |
| 3612 KURL testURL = toKURL("about:blank"); | 3607 KURL testURL = toKURL("about:blank"); |
| 3613 FrameTestHelpers::loadHTMLString(frame, simpleSource, testURL); | 3608 FrameTestHelpers::loadHTMLString(frame, simpleSource, testURL); |
| 3614 | 3609 |
| 3615 // Make sure it comes out OK. | 3610 // Make sure it comes out OK. |
| 3616 const std::string expected("Foo bar\nbaz"); | 3611 const std::string expected("Foo bar\nbaz"); |
| 3617 webViewHelper.webView()->updateAllLifecyclePhases(); | |
| 3618 WebString text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLoca
lFrame(), std::numeric_limits<size_t>::max()); | 3612 WebString text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLoca
lFrame(), std::numeric_limits<size_t>::max()); |
| 3619 EXPECT_EQ(expected, text.utf8()); | 3613 EXPECT_EQ(expected, text.utf8()); |
| 3620 | 3614 |
| 3621 // Try reading the same one with clipping of the text. | 3615 // Try reading the same one with clipping of the text. |
| 3622 const int length = 5; | 3616 const int length = 5; |
| 3623 text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLocalFrame(),
length); | 3617 text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLocalFrame(),
length); |
| 3624 EXPECT_EQ(expected.substr(0, length), text.utf8()); | 3618 EXPECT_EQ(expected.substr(0, length), text.utf8()); |
| 3625 | 3619 |
| 3626 // Now do a new test with a subframe. | 3620 // Now do a new test with a subframe. |
| 3627 const char outerFrameSource[] = "Hello<iframe></iframe> world"; | 3621 const char outerFrameSource[] = "Hello<iframe></iframe> world"; |
| 3628 FrameTestHelpers::loadHTMLString(frame, outerFrameSource, testURL); | 3622 FrameTestHelpers::loadHTMLString(frame, outerFrameSource, testURL); |
| 3629 | 3623 |
| 3630 // Load something into the subframe. | 3624 // Load something into the subframe. |
| 3631 WebFrame* subframe = frame->firstChild(); | 3625 WebFrame* subframe = frame->firstChild(); |
| 3632 ASSERT_TRUE(subframe); | 3626 ASSERT_TRUE(subframe); |
| 3633 FrameTestHelpers::loadHTMLString(subframe, "sub<p>text", testURL); | 3627 FrameTestHelpers::loadHTMLString(subframe, "sub<p>text", testURL); |
| 3634 | 3628 |
| 3635 webViewHelper.webView()->updateAllLifecyclePhases(); | |
| 3636 text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLocalFrame(),
std::numeric_limits<size_t>::max()); | 3629 text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLocalFrame(),
std::numeric_limits<size_t>::max()); |
| 3637 EXPECT_EQ("Hello world\n\nsub\ntext", text.utf8()); | 3630 EXPECT_EQ("Hello world\n\nsub\ntext", text.utf8()); |
| 3638 | 3631 |
| 3639 // Get the frame text where the subframe separator falls on the boundary of | 3632 // Get the frame text where the subframe separator falls on the boundary of |
| 3640 // what we'll take. There used to be a crash in this case. | 3633 // what we'll take. There used to be a crash in this case. |
| 3641 text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLocalFrame(),
12); | 3634 text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLocalFrame(),
12); |
| 3642 EXPECT_EQ("Hello world", text.utf8()); | 3635 EXPECT_EQ("Hello world", text.utf8()); |
| 3643 } | 3636 } |
| 3644 | 3637 |
| 3645 TEST_P(ParameterizedWebFrameTest, GetFullHtmlOfPage) | 3638 TEST_P(ParameterizedWebFrameTest, GetFullHtmlOfPage) |
| 3646 { | 3639 { |
| 3647 FrameTestHelpers::WebViewHelper webViewHelper(this); | 3640 FrameTestHelpers::WebViewHelper webViewHelper(this); |
| 3648 webViewHelper.initializeAndLoad("about:blank", true); | 3641 webViewHelper.initializeAndLoad("about:blank", true); |
| 3649 WebFrame* frame = webViewHelper.webView()->mainFrame(); | 3642 WebFrame* frame = webViewHelper.webView()->mainFrame(); |
| 3650 | 3643 |
| 3651 // Generate a simple test case. | 3644 // Generate a simple test case. |
| 3652 const char simpleSource[] = "<p>Hello</p><p>World</p>"; | 3645 const char simpleSource[] = "<p>Hello</p><p>World</p>"; |
| 3653 KURL testURL = toKURL("about:blank"); | 3646 KURL testURL = toKURL("about:blank"); |
| 3654 FrameTestHelpers::loadHTMLString(frame, simpleSource, testURL); | 3647 FrameTestHelpers::loadHTMLString(frame, simpleSource, testURL); |
| 3655 | 3648 |
| 3656 webViewHelper.webView()->updateAllLifecyclePhases(); | |
| 3657 | |
| 3658 WebString text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLoca
lFrame(), std::numeric_limits<size_t>::max()); | 3649 WebString text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLoca
lFrame(), std::numeric_limits<size_t>::max()); |
| 3659 EXPECT_EQ("Hello\n\nWorld", text.utf8()); | 3650 EXPECT_EQ("Hello\n\nWorld", text.utf8()); |
| 3660 | 3651 |
| 3661 const std::string html = WebFrameContentDumper::dumpAsMarkup(frame->toWebLoc
alFrame()).utf8(); | 3652 const std::string html = WebFrameContentDumper::dumpAsMarkup(frame->toWebLoc
alFrame()).utf8(); |
| 3662 | 3653 |
| 3663 // Load again with the output html. | 3654 // Load again with the output html. |
| 3664 FrameTestHelpers::loadHTMLString(frame, html, testURL); | 3655 FrameTestHelpers::loadHTMLString(frame, html, testURL); |
| 3665 | 3656 |
| 3666 EXPECT_EQ(html, WebFrameContentDumper::dumpAsMarkup(frame->toWebLocalFrame()
).utf8()); | 3657 EXPECT_EQ(html, WebFrameContentDumper::dumpAsMarkup(frame->toWebLocalFrame()
).utf8()); |
| 3667 | 3658 |
| 3668 webViewHelper.webView()->updateAllLifecyclePhases(); | |
| 3669 | |
| 3670 text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLocalFrame(),
std::numeric_limits<size_t>::max()); | 3659 text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLocalFrame(),
std::numeric_limits<size_t>::max()); |
| 3671 EXPECT_EQ("Hello\n\nWorld", text.utf8()); | 3660 EXPECT_EQ("Hello\n\nWorld", text.utf8()); |
| 3672 | 3661 |
| 3673 // Test selection check | 3662 // Test selection check |
| 3674 EXPECT_FALSE(frame->hasSelection()); | 3663 EXPECT_FALSE(frame->hasSelection()); |
| 3675 frame->executeCommand(WebString::fromUTF8("SelectAll")); | 3664 frame->executeCommand(WebString::fromUTF8("SelectAll")); |
| 3676 EXPECT_TRUE(frame->hasSelection()); | 3665 EXPECT_TRUE(frame->hasSelection()); |
| 3677 frame->executeCommand(WebString::fromUTF8("Unselect")); | 3666 frame->executeCommand(WebString::fromUTF8("Unselect")); |
| 3678 EXPECT_FALSE(frame->hasSelection()); | 3667 EXPECT_FALSE(frame->hasSelection()); |
| 3679 WebString selectionHtml = frame->selectionAsMarkup(); | 3668 WebString selectionHtml = frame->selectionAsMarkup(); |
| (...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5136 response.initialize(); | 5125 response.initialize(); |
| 5137 response.setURL(URLTestHelpers::toKURL(errorURL)); | 5126 response.setURL(URLTestHelpers::toKURL(errorURL)); |
| 5138 response.setMIMEType("text/html"); | 5127 response.setMIMEType("text/html"); |
| 5139 response.setHTTPStatusCode(500); | 5128 response.setHTTPStatusCode(500); |
| 5140 WebHistoryItem errorHistoryItem; | 5129 WebHistoryItem errorHistoryItem; |
| 5141 errorHistoryItem.initialize(); | 5130 errorHistoryItem.initialize(); |
| 5142 errorHistoryItem.setURLString(WebString::fromUTF8(errorURL.c_str(), errorURL
.length())); | 5131 errorHistoryItem.setURLString(WebString::fromUTF8(errorURL.c_str(), errorURL
.length())); |
| 5143 Platform::current()->unitTestSupport()->registerMockedErrorURL(URLTestHelper
s::toKURL(errorURL), response, error); | 5132 Platform::current()->unitTestSupport()->registerMockedErrorURL(URLTestHelper
s::toKURL(errorURL), response, error); |
| 5144 FrameTestHelpers::loadHistoryItem(frame, errorHistoryItem, WebHistoryDiffere
ntDocumentLoad, WebURLRequest::UseProtocolCachePolicy); | 5133 FrameTestHelpers::loadHistoryItem(frame, errorHistoryItem, WebHistoryDiffere
ntDocumentLoad, WebURLRequest::UseProtocolCachePolicy); |
| 5145 | 5134 |
| 5146 webViewHelper.webView()->updateAllLifecyclePhases(); | |
| 5147 | |
| 5148 WebString text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLoca
lFrame(), std::numeric_limits<size_t>::max()); | 5135 WebString text = WebFrameContentDumper::dumpFrameTreeAsText(frame->toWebLoca
lFrame(), std::numeric_limits<size_t>::max()); |
| 5149 EXPECT_EQ("This should appear", text.utf8()); | 5136 EXPECT_EQ("This should appear", text.utf8()); |
| 5150 EXPECT_TRUE(webFrameClient.commitCalled()); | 5137 EXPECT_TRUE(webFrameClient.commitCalled()); |
| 5151 } | 5138 } |
| 5152 | 5139 |
| 5153 class TestWillInsertBodyWebFrameClient : public FrameTestHelpers::TestWebFrameCl
ient { | 5140 class TestWillInsertBodyWebFrameClient : public FrameTestHelpers::TestWebFrameCl
ient { |
| 5154 public: | 5141 public: |
| 5155 TestWillInsertBodyWebFrameClient() : m_numBodies(0), m_didLoad(false) | 5142 TestWillInsertBodyWebFrameClient() : m_numBodies(0), m_didLoad(false) |
| 5156 { | 5143 { |
| 5157 } | 5144 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5251 | 5238 |
| 5252 const int allTextBeginOffset = 0; | 5239 const int allTextBeginOffset = 0; |
| 5253 const int allTextLength = 11; | 5240 const int allTextLength = 11; |
| 5254 frame->selectRange(WebRange::fromDocumentRange(frame, allTextBeginOffset, al
lTextLength)); | 5241 frame->selectRange(WebRange::fromDocumentRange(frame, allTextBeginOffset, al
lTextLength)); |
| 5255 EphemeralRange selectionRange = frame->frame()->selection().selection().toNo
rmalizedEphemeralRange(); | 5242 EphemeralRange selectionRange = frame->frame()->selection().selection().toNo
rmalizedEphemeralRange(); |
| 5256 | 5243 |
| 5257 EXPECT_EQ(1, spellcheck.numberOfTimesChecked()); | 5244 EXPECT_EQ(1, spellcheck.numberOfTimesChecked()); |
| 5258 EXPECT_EQ(1U, document->markers().markersInRange(selectionRange, DocumentMar
ker::Spelling).size()); | 5245 EXPECT_EQ(1U, document->markers().markersInRange(selectionRange, DocumentMar
ker::Spelling).size()); |
| 5259 | 5246 |
| 5260 frame->replaceMisspelledRange("welcome"); | 5247 frame->replaceMisspelledRange("welcome"); |
| 5261 | |
| 5262 webViewHelper.webView()->updateAllLifecyclePhases(); | |
| 5263 EXPECT_EQ("_welcome_.", WebFrameContentDumper::dumpFrameTreeAsText(frame, st
d::numeric_limits<size_t>::max()).utf8()); | 5248 EXPECT_EQ("_welcome_.", WebFrameContentDumper::dumpFrameTreeAsText(frame, st
d::numeric_limits<size_t>::max()).utf8()); |
| 5264 } | 5249 } |
| 5265 | 5250 |
| 5266 TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkers) | 5251 TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkers) |
| 5267 { | 5252 { |
| 5268 registerMockedHttpURLLoad("spell.html"); | 5253 registerMockedHttpURLLoad("spell.html"); |
| 5269 FrameTestHelpers::WebViewHelper webViewHelper(this); | 5254 FrameTestHelpers::WebViewHelper webViewHelper(this); |
| 5270 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); | 5255 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); |
| 5271 SpellCheckClient spellcheck; | 5256 SpellCheckClient spellcheck; |
| 5272 webViewHelper.webView()->setSpellCheckClient(&spellcheck); | 5257 webViewHelper.webView()->setSpellCheckClient(&spellcheck); |
| (...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7067 WebRemoteFrame* remoteFrame = WebRemoteFrame::create(WebTreeScopeType::Docum
ent, nullptr); | 7052 WebRemoteFrame* remoteFrame = WebRemoteFrame::create(WebTreeScopeType::Docum
ent, nullptr); |
| 7068 mainFrame()->swap(remoteFrame); | 7053 mainFrame()->swap(remoteFrame); |
| 7069 | 7054 |
| 7070 FrameTestHelpers::TestWebFrameClient client; | 7055 FrameTestHelpers::TestWebFrameClient client; |
| 7071 WebLocalFrame* localFrame = WebLocalFrame::createProvisional(&client, remote
Frame, WebSandboxFlags::None, WebFrameOwnerProperties()); | 7056 WebLocalFrame* localFrame = WebLocalFrame::createProvisional(&client, remote
Frame, WebSandboxFlags::None, WebFrameOwnerProperties()); |
| 7072 remoteFrame->swap(localFrame); | 7057 remoteFrame->swap(localFrame); |
| 7073 | 7058 |
| 7074 // Finally, make sure an embedder triggered load in the local frame swapped | 7059 // Finally, make sure an embedder triggered load in the local frame swapped |
| 7075 // back in works. | 7060 // back in works. |
| 7076 FrameTestHelpers::loadFrame(localFrame, m_baseURL + "subframe-hello.html"); | 7061 FrameTestHelpers::loadFrame(localFrame, m_baseURL + "subframe-hello.html"); |
| 7077 | |
| 7078 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(localFrame,
1024).utf8(); | 7062 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(localFrame,
1024).utf8(); |
| 7079 EXPECT_EQ("hello", content); | 7063 EXPECT_EQ("hello", content); |
| 7080 | 7064 |
| 7081 // Manually reset to break WebViewHelper's dependency on the stack allocated | 7065 // Manually reset to break WebViewHelper's dependency on the stack allocated |
| 7082 // TestWebFrameClient. | 7066 // TestWebFrameClient. |
| 7083 reset(); | 7067 reset(); |
| 7084 remoteFrame->close(); | 7068 remoteFrame->close(); |
| 7085 } | 7069 } |
| 7086 | 7070 |
| 7087 TEST_F(WebFrameSwapTest, ValidateSizeOnRemoteToLocalMainFrameSwap) | 7071 TEST_F(WebFrameSwapTest, ValidateSizeOnRemoteToLocalMainFrameSwap) |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8535 } | 8519 } |
| 8536 | 8520 |
| 8537 TEST_F(WebFrameVisibilityChangeTest, RemoteFrameParentVisibilityChange) | 8521 TEST_F(WebFrameVisibilityChangeTest, RemoteFrameParentVisibilityChange) |
| 8538 { | 8522 { |
| 8539 swapLocalFrameToRemoteFrame(); | 8523 swapLocalFrameToRemoteFrame(); |
| 8540 executeScriptOnMainFrame(WebScriptSource("document.querySelector('iframe').p
arentElement.style.display = 'none';")); | 8524 executeScriptOnMainFrame(WebScriptSource("document.querySelector('iframe').p
arentElement.style.display = 'none';")); |
| 8541 EXPECT_FALSE(remoteFrameClient()->isVisible()); | 8525 EXPECT_FALSE(remoteFrameClient()->isVisible()); |
| 8542 } | 8526 } |
| 8543 | 8527 |
| 8544 } // namespace blink | 8528 } // namespace blink |
| OLD | NEW |