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 7106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7117 mainFrame()->executeScript(WebScriptSource( | 7117 mainFrame()->executeScript(WebScriptSource( |
7118 "document.getElementsByTagName('iframe')[0].contentWindow.location = 'da
ta:text/html,hi'")); | 7118 "document.getElementsByTagName('iframe')[0].contentWindow.location = 'da
ta:text/html,hi'")); |
7119 ASSERT_FALSE(client.lastRequest().isNull()); | 7119 ASSERT_FALSE(client.lastRequest().isNull()); |
7120 EXPECT_EQ(WebURL(toKURL("data:text/html,hi")), client.lastRequest().url()); | 7120 EXPECT_EQ(WebURL(toKURL("data:text/html,hi")), client.lastRequest().url()); |
7121 | 7121 |
7122 // Manually reset to break WebViewHelper's dependency on the stack allocated | 7122 // Manually reset to break WebViewHelper's dependency on the stack allocated |
7123 // TestWebFrameClient. | 7123 // TestWebFrameClient. |
7124 reset(); | 7124 reset(); |
7125 } | 7125 } |
7126 | 7126 |
| 7127 TEST_F(WebFrameSwapTest, WindowOpenOnRemoteFrame) |
| 7128 { |
| 7129 RemoteNavigationClient remoteClient; |
| 7130 WebRemoteFrame* remoteFrame = remoteClient.frame(); |
| 7131 mainFrame()->firstChild()->swap(remoteFrame); |
| 7132 remoteFrame->setReplicatedOrigin(WebSecurityOrigin::createFromString("http:/
/127.0.0.1")); |
| 7133 |
| 7134 KURL destination = toKURL("data:text/html:destination"); |
| 7135 ASSERT_TRUE(mainFrame()->isWebLocalFrame()); |
| 7136 ASSERT_TRUE(mainFrame()->firstChild()->isWebRemoteFrame()); |
| 7137 LocalDOMWindow* mainWindow = toWebLocalFrameImpl(mainFrame())->frame()->loca
lDOMWindow(); |
| 7138 mainWindow->open(destination.string(), "frame1", "", mainWindow, mainWindow)
; |
| 7139 ASSERT_FALSE(remoteClient.lastRequest().isNull()); |
| 7140 EXPECT_EQ(remoteClient.lastRequest().url(), WebURL(destination)); |
| 7141 |
| 7142 reset(); |
| 7143 } |
| 7144 |
7127 class CommitTypeWebFrameClient : public FrameTestHelpers::TestWebFrameClient { | 7145 class CommitTypeWebFrameClient : public FrameTestHelpers::TestWebFrameClient { |
7128 public: | 7146 public: |
7129 explicit CommitTypeWebFrameClient() | 7147 explicit CommitTypeWebFrameClient() |
7130 : m_historyCommitType(WebHistoryInertCommit) | 7148 : m_historyCommitType(WebHistoryInertCommit) |
7131 { | 7149 { |
7132 } | 7150 } |
7133 | 7151 |
7134 void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHist
oryCommitType historyCommitType) override | 7152 void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHist
oryCommitType historyCommitType) override |
7135 { | 7153 { |
7136 m_historyCommitType = historyCommitType; | 7154 m_historyCommitType = historyCommitType; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7323 ASSERT_EQ(2u, popupWebFrameClient.messages.size()); | 7341 ASSERT_EQ(2u, popupWebFrameClient.messages.size()); |
7324 EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[1].text.utf8()
.find("Blocked a frame")); | 7342 EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[1].text.utf8()
.find("Blocked a frame")); |
7325 | 7343 |
7326 // Manually reset to break WebViewHelpers' dependencies on the stack | 7344 // Manually reset to break WebViewHelpers' dependencies on the stack |
7327 // allocated WebFrameClients. | 7345 // allocated WebFrameClients. |
7328 webViewHelper.reset(); | 7346 webViewHelper.reset(); |
7329 popupWebViewHelper.reset(); | 7347 popupWebViewHelper.reset(); |
7330 } | 7348 } |
7331 | 7349 |
7332 } // namespace blink | 7350 } // namespace blink |
OLD | NEW |