Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/dom/Document.h" | 5 #include "core/dom/Document.h" |
| 6 #include "core/dom/Element.h" | 6 #include "core/dom/Element.h" |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/html/HTMLIFrameElement.h" | 8 #include "core/html/HTMLIFrameElement.h" |
| 9 #include "platform/testing/URLTestHelpers.h" | 9 #include "platform/testing/URLTestHelpers.h" |
| 10 #include "platform/testing/UnitTestHelpers.h" | 10 #include "platform/testing/UnitTestHelpers.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 webView->resize(WebSize(640, 480)); | 317 webView->resize(WebSize(640, 480)); |
| 318 | 318 |
| 319 // Create a remote root frame with a local child frame. | 319 // Create a remote root frame with a local child frame. |
| 320 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; | 320 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; |
| 321 webView->setMainFrame(remoteClient.frame()); | 321 webView->setMainFrame(remoteClient.frame()); |
| 322 remoteClient.frame()->setReplicatedOrigin(WebSecurityOrigin::createUnique()) ; | 322 remoteClient.frame()->setReplicatedOrigin(WebSecurityOrigin::createUnique()) ; |
| 323 | 323 |
| 324 WebFrameOwnerProperties properties; | 324 WebFrameOwnerProperties properties; |
| 325 FrameTestHelpers::TestWebFrameClient localFrameClient; | 325 FrameTestHelpers::TestWebFrameClient localFrameClient; |
| 326 WebRemoteFrame* rootFrame = webView->mainFrame()->toWebRemoteFrame(); | 326 WebRemoteFrame* rootFrame = webView->mainFrame()->toWebRemoteFrame(); |
| 327 WebLocalFrame* localFrame = rootFrame->createLocalChild(WebTreeScopeType::Do cument, "", WebSandboxFlags::None, &localFrameClient, nullptr, properties); | 327 WebLocalFrame* localFrame = rootFrame->createLocalChild(WebTreeScopeType::Do cument, "name", "uniqueName", WebSandboxFlags::None, &localFrameClient, nullptr, properties); |
|
dcheng
2016/02/16 22:17:29
I would have expected name == uniqueName for most
Łukasz Anforowicz
2016/02/16 23:39:53
In product code, we have name == uniqueName for th
dcheng
2016/02/19 18:14:57
I don't know, it just seems weird to explicitly ha
Łukasz Anforowicz
2016/02/19 19:56:59
Good idea for introducing a helper - this reduces
| |
| 328 | 328 |
| 329 WebString baseURL("http://internal.test/"); | 329 WebString baseURL("http://internal.test/"); |
| 330 URLTestHelpers::registerMockedURLFromBaseURL(baseURL, "simple_div.html"); | 330 URLTestHelpers::registerMockedURLFromBaseURL(baseURL, "simple_div.html"); |
| 331 FrameTestHelpers::loadFrame(localFrame, baseURL.utf8() + "simple_div.html"); | 331 FrameTestHelpers::loadFrame(localFrame, baseURL.utf8() + "simple_div.html"); |
| 332 | 332 |
| 333 FrameView* frameView = toWebLocalFrameImpl(localFrame)->frameView(); | 333 FrameView* frameView = toWebLocalFrameImpl(localFrame)->frameView(); |
| 334 EXPECT_TRUE(frameView->frame().isLocalRoot()); | 334 EXPECT_TRUE(frameView->frame().isLocalRoot()); |
| 335 | 335 |
| 336 // Enable throttling for the child frame. | 336 // Enable throttling for the child frame. |
| 337 frameView->setFrameRect(IntRect(0, 480, frameView->width(), frameView->heigh t())); | 337 frameView->setFrameRect(IntRect(0, 480, frameView->width(), frameView->heigh t())); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 350 | 350 |
| 351 // Update the lifecycle again. The frame's lifecycle should not advance | 351 // Update the lifecycle again. The frame's lifecycle should not advance |
| 352 // because of throttling even though it is the local root. | 352 // because of throttling even though it is the local root. |
| 353 frameView->updateAllLifecyclePhases(); | 353 frameView->updateAllLifecyclePhases(); |
| 354 testing::runPendingTasks(); | 354 testing::runPendingTasks(); |
| 355 EXPECT_EQ(DocumentLifecycle::VisualUpdatePending, frameDocument->lifecycle() .state()); | 355 EXPECT_EQ(DocumentLifecycle::VisualUpdatePending, frameDocument->lifecycle() .state()); |
| 356 webView->close(); | 356 webView->close(); |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace blink | 359 } // namespace blink |
| OLD | NEW |