Chromium Code Reviews| 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 8092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8103 WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible); | 8103 WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible); |
| 8104 view->setMainFrame(remoteClient.frame()); | 8104 view->setMainFrame(remoteClient.frame()); |
| 8105 WebRemoteFrame* remoteRoot = view->mainFrame()->toWebRemoteFrame(); | 8105 WebRemoteFrame* remoteRoot = view->mainFrame()->toWebRemoteFrame(); |
| 8106 remoteRoot->setReplicatedOrigin(SecurityOrigin::createUnique()); | 8106 remoteRoot->setReplicatedOrigin(SecurityOrigin::createUnique()); |
| 8107 | 8107 |
| 8108 FrameTestHelpers::createLocalChild(remoteRoot); | 8108 FrameTestHelpers::createLocalChild(remoteRoot); |
| 8109 | 8109 |
| 8110 // Do a remote-to-local swap of the top frame. | 8110 // Do a remote-to-local swap of the top frame. |
| 8111 FrameTestHelpers::TestWebFrameClient localClient; | 8111 FrameTestHelpers::TestWebFrameClient localClient; |
| 8112 WebLocalFrame* localRoot = WebLocalFrame::createProvisional(&localClient, re moteRoot, WebSandboxFlags::None); | 8112 WebLocalFrame* localRoot = WebLocalFrame::createProvisional(&localClient, re moteRoot, WebSandboxFlags::None); |
| 8113 FrameTestHelpers::TestWebWidgetClient webWidgetClient; | |
| 8114 WebFrameWidget::create(&webWidgetClient, localRoot); | |
|
dcheng
2016/09/02 08:57:39
Would it be better to just make FrameTestHelpers d
lfg
2016/09/02 17:36:38
In this case I didn't think it was worth the effor
| |
| 8113 remoteRoot->swap(localRoot); | 8115 remoteRoot->swap(localRoot); |
| 8114 | 8116 |
| 8115 // Load a page with a child frame in the new root to make sure this doesn't | 8117 // Load a page with a child frame in the new root to make sure this doesn't |
| 8116 // crash when the child frame invokes setCoreFrame. | 8118 // crash when the child frame invokes setCoreFrame. |
| 8117 registerMockedHttpURLLoad("single_iframe.html"); | 8119 registerMockedHttpURLLoad("single_iframe.html"); |
| 8118 registerMockedHttpURLLoad("visible_iframe.html"); | 8120 registerMockedHttpURLLoad("visible_iframe.html"); |
| 8119 FrameTestHelpers::loadFrame(localRoot, m_baseURL + "single_iframe.html"); | 8121 FrameTestHelpers::loadFrame(localRoot, m_baseURL + "single_iframe.html"); |
| 8120 | 8122 |
| 8121 view->close(); | 8123 view->close(); |
| 8122 } | 8124 } |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8935 FrameTestHelpers::WebViewHelper helper; | 8937 FrameTestHelpers::WebViewHelper helper; |
| 8936 helper.initializeAndLoad(url, true); | 8938 helper.initializeAndLoad(url, true); |
| 8937 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); | 8939 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); |
| 8938 | 8940 |
| 8939 Document* document = toLocalFrame(helper.webView()->page()->mainFrame())->do cument(); | 8941 Document* document = toLocalFrame(helper.webView()->page()->mainFrame())->do cument(); |
| 8940 EXPECT_TRUE(document->isImageDocument()); | 8942 EXPECT_TRUE(document->isImageDocument()); |
| 8941 EXPECT_EQ(Resource::DecodeError, toImageDocument(document)->cachedImage()->g etStatus()); | 8943 EXPECT_EQ(Resource::DecodeError, toImageDocument(document)->cachedImage()->g etStatus()); |
| 8942 } | 8944 } |
| 8943 | 8945 |
| 8944 } // namespace blink | 8946 } // namespace blink |
| OLD | NEW |