From 537abce1bcf7378e760e904d6e5540a02a2fca9f Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Wed, 19 Dec 2012 12:52:39 +0000 Subject: [content shell] reset the CWD after each layout test BUG=111316 R=marja@chromium.org Review URL: https://codereview.chromium.org/11633017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173906 0039d316-1c4b-4281-b951-d872f2087c98 --- content/shell/shell_browser_main.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'content/shell/shell_browser_main.cc') diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc index 9e6deb2..cc7bc42 100644 --- a/content/shell/shell_browser_main.cc +++ b/content/shell/shell_browser_main.cc @@ -135,6 +135,13 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) { std::cout.flush(); #endif + FilePath original_cwd; + { + // We're outside of the message loop here, and this is a test. + base::ThreadRestrictions::ScopedAllowIO allow_io; + file_util::GetCurrentDirectory(&original_cwd); + } + while (GetNextTest(args, &command_line_position, &test_string)) { if (test_string.empty()) continue; @@ -154,6 +161,12 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) { ran_at_least_once = true; main_runner_->Run(); + { + // We're outside of the message loop here, and this is a test. + base::ThreadRestrictions::ScopedAllowIO allow_io; + file_util::SetCurrentDirectory(original_cwd); + } + if (!content::WebKitTestController::Get()->ResetAfterLayoutTest()) break; } -- cgit v1.1