diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 17:31:00 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 17:31:00 +0000 |
commit | 2f2b951acc3dda01b66b0f476e2e8e110b31d414 (patch) | |
tree | cdc72a680af8f62456e7eac84adc0b45b4c3a5b5 /content | |
parent | 45c517c08a3d7649fe4d2331c63fd75cfb970469 (diff) | |
download | chromium_src-2f2b951acc3dda01b66b0f476e2e8e110b31d414.zip chromium_src-2f2b951acc3dda01b66b0f476e2e8e110b31d414.tar.gz chromium_src-2f2b951acc3dda01b66b0f476e2e8e110b31d414.tar.bz2 |
Use a fresh, temporary profile when running content_shell in DRT mode
Also fix layout test controller bindings after my last change
BUG=none
TEST=manual
Review URL: https://chromiumcodereview.appspot.com/10545087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/shell/layout_test_controller_bindings.cc | 5 | ||||
-rw-r--r-- | content/shell/shell_browser_context.cc | 7 | ||||
-rw-r--r-- | content/shell/shell_browser_context.h | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/content/shell/layout_test_controller_bindings.cc b/content/shell/layout_test_controller_bindings.cc index 59fecec..20131ad 100644 --- a/content/shell/layout_test_controller_bindings.cc +++ b/content/shell/layout_test_controller_bindings.cc @@ -124,6 +124,11 @@ LayoutTestControllerBindings::GetNativeFunction(v8::Handle<v8::String> name) { return v8::FunctionTemplate::New(SetDumpChildFramesAsText); if (name->Equals(v8::String::New("SetPrinting"))) return v8::FunctionTemplate::New(SetPrinting); + if (name->Equals(v8::String::New( + "SetShouldStayOnPageAfterHandlingBeforeUnload"))) { + return v8::FunctionTemplate::New( + SetShouldStayOnPageAfterHandlingBeforeUnload); + } if (name->Equals(v8::String::New("SetWaitUntilDone"))) return v8::FunctionTemplate::New(SetWaitUntilDone); diff --git a/content/shell/shell_browser_context.cc b/content/shell/shell_browser_context.cc index 53134ee..3af52d4 100644 --- a/content/shell/shell_browser_context.cc +++ b/content/shell/shell_browser_context.cc @@ -5,6 +5,7 @@ #include "content/shell/shell_browser_context.h" #include "base/bind.h" +#include "base/command_line.h" #include "base/environment.h" #include "base/file_util.h" #include "base/logging.h" @@ -13,6 +14,7 @@ #include "content/public/browser/browser_thread.h" #include "content/shell/shell_download_manager_delegate.h" #include "content/shell/shell_resource_context.h" +#include "content/shell/shell_switches.h" #include "content/shell/shell_url_request_context_getter.h" #if defined(OS_WIN) @@ -48,6 +50,11 @@ ShellBrowserContext::~ShellBrowserContext() { } void ShellBrowserContext::InitWhileIOAllowed() { + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { + CHECK(testing_path_.CreateUniqueTempDir()); + path_ = testing_path_.path(); + return; + } #if defined(OS_WIN) CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &path_)); path_ = path_.Append(std::wstring(L"content_shell")); diff --git a/content/shell/shell_browser_context.h b/content/shell/shell_browser_context.h index b4e3899..52d072f 100644 --- a/content/shell/shell_browser_context.h +++ b/content/shell/shell_browser_context.h @@ -10,6 +10,7 @@ #include "base/file_path.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" +#include "base/scoped_temp_dir.h" #include "content/public/browser/browser_context.h" namespace content { @@ -45,6 +46,7 @@ class ShellBrowserContext : public BrowserContext { // allowed on the current thread. void InitWhileIOAllowed(); + ScopedTempDir testing_path_; FilePath path_; scoped_ptr<ResourceContext> resource_context_; scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_; |