Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

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

Powered by Google App Engine
This is Rietveld 408576698