| 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 7084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7095 mainFrame()->executeScript(WebScriptSource( | 7095 mainFrame()->executeScript(WebScriptSource( |
| 7096 "document.getElementsByTagName('iframe')[0].contentWindow.location = 'da
ta:text/html,hi'")); | 7096 "document.getElementsByTagName('iframe')[0].contentWindow.location = 'da
ta:text/html,hi'")); |
| 7097 ASSERT_FALSE(client.lastRequest().isNull()); | 7097 ASSERT_FALSE(client.lastRequest().isNull()); |
| 7098 EXPECT_EQ(WebURL(toKURL("data:text/html,hi")), client.lastRequest().url()); | 7098 EXPECT_EQ(WebURL(toKURL("data:text/html,hi")), client.lastRequest().url()); |
| 7099 | 7099 |
| 7100 // Manually reset to break WebViewHelper's dependency on the stack allocated | 7100 // Manually reset to break WebViewHelper's dependency on the stack allocated |
| 7101 // TestWebFrameClient. | 7101 // TestWebFrameClient. |
| 7102 reset(); | 7102 reset(); |
| 7103 } | 7103 } |
| 7104 | 7104 |
| 7105 TEST_F(WebFrameSwapTest, WindowOpenOnRemoteFrame) |
| 7106 { |
| 7107 RemoteNavigationClient remoteClient; |
| 7108 WebRemoteFrame* remoteFrame = remoteClient.frame(); |
| 7109 mainFrame()->firstChild()->swap(remoteFrame); |
| 7110 remoteFrame->setReplicatedOrigin(WebSecurityOrigin::createFromString("http:/
/127.0.0.1")); |
| 7111 |
| 7112 KURL destination = toKURL("data:text/html:destination"); |
| 7113 ASSERT_TRUE(mainFrame()->isWebLocalFrame()); |
| 7114 ASSERT_TRUE(mainFrame()->firstChild()->isWebRemoteFrame()); |
| 7115 LocalDOMWindow* mainWindow = toWebLocalFrameImpl(mainFrame())->frame()->loca
lDOMWindow(); |
| 7116 mainWindow->open(destination.string(), "frame1", "", mainWindow, mainWindow)
; |
| 7117 ASSERT_FALSE(remoteClient.lastRequest().isNull()); |
| 7118 EXPECT_EQ(remoteClient.lastRequest().url(), WebURL(destination)); |
| 7119 |
| 7120 reset(); |
| 7121 } |
| 7122 |
| 7105 class CommitTypeWebFrameClient : public FrameTestHelpers::TestWebFrameClient { | 7123 class CommitTypeWebFrameClient : public FrameTestHelpers::TestWebFrameClient { |
| 7106 public: | 7124 public: |
| 7107 explicit CommitTypeWebFrameClient() | 7125 explicit CommitTypeWebFrameClient() |
| 7108 : m_historyCommitType(WebHistoryInertCommit) | 7126 : m_historyCommitType(WebHistoryInertCommit) |
| 7109 { | 7127 { |
| 7110 } | 7128 } |
| 7111 | 7129 |
| 7112 void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHist
oryCommitType historyCommitType) override | 7130 void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHist
oryCommitType historyCommitType) override |
| 7113 { | 7131 { |
| 7114 m_historyCommitType = historyCommitType; | 7132 m_historyCommitType = historyCommitType; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7301 ASSERT_EQ(2u, popupWebFrameClient.messages.size()); | 7319 ASSERT_EQ(2u, popupWebFrameClient.messages.size()); |
| 7302 EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[1].text.utf8()
.find("Blocked a frame")); | 7320 EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[1].text.utf8()
.find("Blocked a frame")); |
| 7303 | 7321 |
| 7304 // Manually reset to break WebViewHelpers' dependencies on the stack | 7322 // Manually reset to break WebViewHelpers' dependencies on the stack |
| 7305 // allocated WebFrameClients. | 7323 // allocated WebFrameClients. |
| 7306 webViewHelper.reset(); | 7324 webViewHelper.reset(); |
| 7307 popupWebViewHelper.reset(); | 7325 popupWebViewHelper.reset(); |
| 7308 } | 7326 } |
| 7309 | 7327 |
| 7310 } // namespace blink | 7328 } // namespace blink |
| OLD | NEW |