Commit 0503da2b authored by jochen@chromium.org's avatar jochen@chromium.org

Revert 170451 - [content shell] add support for testRunner.canOpenWindows and...

Revert 170451 - [content shell] add support for testRunner.canOpenWindows and disallow opening windows per default for layout tests

BUG=111316
R=marja@chromium.org

Review URL: https://codereview.chromium.org/11411282

TBR=jochen@chromium.org
Review URL: https://codereview.chromium.org/11414260

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170459 0039d316-1c4b-4281-b951-d872f2087c98
parent f8ea5741
...@@ -121,19 +121,6 @@ WebContentsViewDelegate* ShellContentBrowserClient::GetWebContentsViewDelegate( ...@@ -121,19 +121,6 @@ WebContentsViewDelegate* ShellContentBrowserClient::GetWebContentsViewDelegate(
return NULL; return NULL;
} }
bool ShellContentBrowserClient::CanCreateWindow(
const GURL& opener_url,
const GURL& origin,
WindowContainerType container_type,
ResourceContext* context,
int render_process_id,
bool* no_javascript_access) {
*no_javascript_access = false;
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
return true;
return WebKitTestController::Get()->can_open_windows();
}
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const CommandLine& command_line, const CommandLine& command_line,
......
...@@ -39,13 +39,6 @@ class ShellContentBrowserClient : public ContentBrowserClient { ...@@ -39,13 +39,6 @@ class ShellContentBrowserClient : public ContentBrowserClient {
virtual std::string GetDefaultDownloadName() OVERRIDE; virtual std::string GetDefaultDownloadName() OVERRIDE;
virtual WebContentsViewDelegate* GetWebContentsViewDelegate( virtual WebContentsViewDelegate* GetWebContentsViewDelegate(
WebContents* web_contents) OVERRIDE; WebContents* web_contents) OVERRIDE;
virtual bool CanCreateWindow(
const GURL& opener_url,
const GURL& source_origin,
WindowContainerType container_type,
ResourceContext* context,
int render_process_id,
bool* no_javascript_access) OVERRIDE;
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
virtual void GetAdditionalMappedFilesForChildProcess( virtual void GetAdditionalMappedFilesForChildProcess(
......
...@@ -69,7 +69,6 @@ IPC_MESSAGE_ROUTED1( ...@@ -69,7 +69,6 @@ IPC_MESSAGE_ROUTED1(
IPC_MESSAGE_ROUTED0(ShellViewHostMsg_WaitUntilDone) IPC_MESSAGE_ROUTED0(ShellViewHostMsg_WaitUntilDone)
IPC_MESSAGE_ROUTED1(ShellViewHostMsg_OverridePreferences, IPC_MESSAGE_ROUTED1(ShellViewHostMsg_OverridePreferences,
content::ShellWebPreferences /* preferences */) content::ShellWebPreferences /* preferences */)
IPC_MESSAGE_ROUTED0(ShellViewHostMsg_CanOpenWindows)
IPC_MESSAGE_ROUTED2(ShellViewHostMsg_NotImplemented, IPC_MESSAGE_ROUTED2(ShellViewHostMsg_NotImplemented,
std::string /* object_name */, std::string /* object_name */,
......
...@@ -8,7 +8,6 @@ var testRunner = testRunner || {}; ...@@ -8,7 +8,6 @@ var testRunner = testRunner || {};
native function Display(); native function Display();
native function GetWorkerThreadCount(); native function GetWorkerThreadCount();
native function NotifyDone(); native function NotifyDone();
native function SetCanOpenWindows();
native function SetDumpAsText(); native function SetDumpAsText();
native function SetDumpChildFramesAsText(); native function SetDumpChildFramesAsText();
native function SetPrinting(); native function SetPrinting();
...@@ -42,9 +41,6 @@ var testRunner = testRunner || {}; ...@@ -42,9 +41,6 @@ var testRunner = testRunner || {};
Object.defineProperty(this, Object.defineProperty(this,
"dumpChildFramesAsText", "dumpChildFramesAsText",
{value: SetDumpChildFramesAsText}); {value: SetDumpChildFramesAsText});
Object.defineProperty(this,
"setCanOpenWindows",
{value: SetCanOpenWindows});
Object.defineProperty(this, "setPrinting", {value: SetPrinting}); Object.defineProperty(this, "setPrinting", {value: SetPrinting});
Object.defineProperty( Object.defineProperty(
this, this,
......
...@@ -62,15 +62,6 @@ v8::Handle<v8::Value> NotifyDone(const v8::Arguments& args) { ...@@ -62,15 +62,6 @@ v8::Handle<v8::Value> NotifyDone(const v8::Arguments& args) {
return v8::Undefined(); return v8::Undefined();
} }
v8::Handle<v8::Value> SetCanOpenWindows(const v8::Arguments& args) {
RenderView* view = GetCurrentRenderView();
if (!view)
return v8::Undefined();
view->Send(new ShellViewHostMsg_CanOpenWindows(view->GetRoutingID()));
return v8::Undefined();
}
v8::Handle<v8::Value> SetDumpAsText(const v8::Arguments& args) { v8::Handle<v8::Value> SetDumpAsText(const v8::Arguments& args) {
RenderView* view = GetCurrentRenderView(); RenderView* view = GetCurrentRenderView();
if (!view) if (!view)
...@@ -182,8 +173,6 @@ WebKitTestRunnerBindings::GetNativeFunction(v8::Handle<v8::String> name) { ...@@ -182,8 +173,6 @@ WebKitTestRunnerBindings::GetNativeFunction(v8::Handle<v8::String> name) {
return v8::FunctionTemplate::New(Display); return v8::FunctionTemplate::New(Display);
if (name->Equals(v8::String::New("NotifyDone"))) if (name->Equals(v8::String::New("NotifyDone")))
return v8::FunctionTemplate::New(NotifyDone); return v8::FunctionTemplate::New(NotifyDone);
if (name->Equals(v8::String::New("SetCanOpenWindows")))
return v8::FunctionTemplate::New(SetCanOpenWindows);
if (name->Equals(v8::String::New("SetDumpAsText"))) if (name->Equals(v8::String::New("SetDumpAsText")))
return v8::FunctionTemplate::New(SetDumpAsText); return v8::FunctionTemplate::New(SetDumpAsText);
if (name->Equals(v8::String::New("SetDumpChildFramesAsText"))) if (name->Equals(v8::String::New("SetDumpChildFramesAsText")))
......
...@@ -181,7 +181,6 @@ bool WebKitTestController::ResetAfterLayoutTest() { ...@@ -181,7 +181,6 @@ bool WebKitTestController::ResetAfterLayoutTest() {
should_stay_on_page_after_handling_before_unload_ = false; should_stay_on_page_after_handling_before_unload_ = false;
wait_until_done_ = false; wait_until_done_ = false;
prefs_ = ShellWebPreferences(); prefs_ = ShellWebPreferences();
can_open_windows_ = false;
watchdog_.Cancel(); watchdog_.Cancel();
if (main_window_) { if (main_window_) {
Observe(NULL); Observe(NULL);
...@@ -381,7 +380,6 @@ bool WebKitTestRunnerHost::OnMessageReceived( ...@@ -381,7 +380,6 @@ bool WebKitTestRunnerHost::OnMessageReceived(
OnSetShouldStayOnPageAfterHandlingBeforeUnload) OnSetShouldStayOnPageAfterHandlingBeforeUnload)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_WaitUntilDone, OnWaitUntilDone) IPC_MESSAGE_HANDLER(ShellViewHostMsg_WaitUntilDone, OnWaitUntilDone)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_NotImplemented, OnNotImplemented) IPC_MESSAGE_HANDLER(ShellViewHostMsg_NotImplemented, OnNotImplemented)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_CanOpenWindows, OnCanOpenWindows)
IPC_MESSAGE_UNHANDLED(handled = false) IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP() IPC_END_MESSAGE_MAP()
...@@ -421,8 +419,4 @@ void WebKitTestRunnerHost::OnNotImplemented( ...@@ -421,8 +419,4 @@ void WebKitTestRunnerHost::OnNotImplemented(
WebKitTestController::Get()->NotImplemented(object_name, property_name); WebKitTestController::Get()->NotImplemented(object_name, property_name);
} }
void WebKitTestRunnerHost::OnCanOpenWindows() {
WebKitTestController::Get()->set_can_open_windows(true);
}
} // namespace content } // namespace content
...@@ -109,10 +109,6 @@ class WebKitTestController : public base::NonThreadSafe, ...@@ -109,10 +109,6 @@ class WebKitTestController : public base::NonThreadSafe,
} }
bool is_printing() const { return is_printing_; } bool is_printing() const { return is_printing_; }
void set_is_printing(bool is_printing) { is_printing_ = is_printing; } void set_is_printing(bool is_printing) { is_printing_ = is_printing; }
bool can_open_windows() const { return can_open_windows_; }
void set_can_open_windows(bool can_open_windows) {
can_open_windows_ = can_open_windows;
}
// WebContentsObserver implementation. // WebContentsObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
...@@ -150,7 +146,6 @@ class WebKitTestController : public base::NonThreadSafe, ...@@ -150,7 +146,6 @@ class WebKitTestController : public base::NonThreadSafe,
bool is_printing_; bool is_printing_;
bool should_stay_on_page_after_handling_before_unload_; bool should_stay_on_page_after_handling_before_unload_;
bool wait_until_done_; bool wait_until_done_;
bool can_open_windows_;
ShellWebPreferences prefs_; ShellWebPreferences prefs_;
base::CancelableClosure watchdog_; base::CancelableClosure watchdog_;
...@@ -174,7 +169,6 @@ class WebKitTestRunnerHost : public RenderViewHostObserver { ...@@ -174,7 +169,6 @@ class WebKitTestRunnerHost : public RenderViewHostObserver {
void OnSetPrinting(); void OnSetPrinting();
void OnSetShouldStayOnPageAfterHandlingBeforeUnload(bool should_stay_on_page); void OnSetShouldStayOnPageAfterHandlingBeforeUnload(bool should_stay_on_page);
void OnWaitUntilDone(); void OnWaitUntilDone();
void OnCanOpenWindows();
void OnNotImplemented(const std::string& object_name, void OnNotImplemented(const std::string& object_name,
const std::string& method_name); const std::string& method_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment