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

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

Issue 1109213002: Make createWindow (mostly) work with OOPIF (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
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 7049 matching lines...) Expand 10 before | Expand all | Expand 10 after
7060 mainFrame()->executeScript(WebScriptSource( 7060 mainFrame()->executeScript(WebScriptSource(
7061 "document.getElementsByTagName('iframe')[0].contentWindow.location = 'da ta:text/html,hi'")); 7061 "document.getElementsByTagName('iframe')[0].contentWindow.location = 'da ta:text/html,hi'"));
7062 ASSERT_FALSE(client.lastRequest().isNull()); 7062 ASSERT_FALSE(client.lastRequest().isNull());
7063 EXPECT_EQ(WebURL(toKURL("data:text/html,hi")), client.lastRequest().url()); 7063 EXPECT_EQ(WebURL(toKURL("data:text/html,hi")), client.lastRequest().url());
7064 7064
7065 // Manually reset to break WebViewHelper's dependency on the stack allocated 7065 // Manually reset to break WebViewHelper's dependency on the stack allocated
7066 // TestWebFrameClient. 7066 // TestWebFrameClient.
7067 reset(); 7067 reset();
7068 } 7068 }
7069 7069
7070 TEST_F(WebFrameSwapTest, WindowOpenOnRemoteFrame)
7071 {
7072 RemoteNavigationClient remoteClient;
7073 WebRemoteFrame* remoteFrame = remoteClient.frame();
7074 mainFrame()->firstChild()->swap(remoteFrame);
7075 remoteFrame->setReplicatedOrigin(WebSecurityOrigin::createFromString("http:/ /127.0.0.1"));
7076
7077 KURL destination = toKURL("data:text/html:destination");
7078 ASSERT_TRUE(mainFrame()->isWebLocalFrame());
7079 ASSERT_TRUE(mainFrame()->firstChild()->isWebRemoteFrame());
7080 LocalDOMWindow* mainWindow = toWebLocalFrameImpl(mainFrame())->frame()->loca lDOMWindow();
7081 mainWindow->open(destination.string(), "frame1", "", mainWindow, mainWindow) ;
7082 ASSERT_FALSE(remoteClient.lastRequest().isNull());
7083 EXPECT_EQ(remoteClient.lastRequest().url(), WebURL(destination));
7084
7085 reset();
7086 }
7087
7070 class MockDocumentThreadableLoaderClient : public DocumentThreadableLoaderClient { 7088 class MockDocumentThreadableLoaderClient : public DocumentThreadableLoaderClient {
7071 public: 7089 public:
7072 MockDocumentThreadableLoaderClient() : m_failed(false) { } 7090 MockDocumentThreadableLoaderClient() : m_failed(false) { }
7073 virtual void didFail(const ResourceError&) override { m_failed = true;} 7091 virtual void didFail(const ResourceError&) override { m_failed = true;}
7074 7092
7075 void reset() { m_failed = false; } 7093 void reset() { m_failed = false; }
7076 bool failed() { return m_failed; } 7094 bool failed() { return m_failed; }
7077 7095
7078 bool m_failed; 7096 bool m_failed;
7079 }; 7097 };
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
7231 ASSERT_EQ(2u, popupWebFrameClient.messages.size()); 7249 ASSERT_EQ(2u, popupWebFrameClient.messages.size());
7232 EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[1].text.utf8() .find("Blocked a frame")); 7250 EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[1].text.utf8() .find("Blocked a frame"));
7233 7251
7234 // Manually reset to break WebViewHelpers' dependencies on the stack 7252 // Manually reset to break WebViewHelpers' dependencies on the stack
7235 // allocated WebFrameClients. 7253 // allocated WebFrameClients.
7236 webViewHelper.reset(); 7254 webViewHelper.reset();
7237 popupWebViewHelper.reset(); 7255 popupWebViewHelper.reset();
7238 } 7256 }
7239 7257
7240 } // namespace blink 7258 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698