summaryrefslogtreecommitdiffstats
path: root/content/shell/shell_browser_main.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-19 12:52:39 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-19 12:52:39 +0000
commit537abce1bcf7378e760e904d6e5540a02a2fca9f (patch)
tree8c946ff2dce2b5febadd9c347bb547cf5db5f010 /content/shell/shell_browser_main.cc
parentbb70d7c2f2283cfaf3c474c78c339714b1530d5f (diff)
downloadchromium_src-537abce1bcf7378e760e904d6e5540a02a2fca9f.zip
chromium_src-537abce1bcf7378e760e904d6e5540a02a2fca9f.tar.gz
chromium_src-537abce1bcf7378e760e904d6e5540a02a2fca9f.tar.bz2
[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
Diffstat (limited to 'content/shell/shell_browser_main.cc')
-rw-r--r--content/shell/shell_browser_main.cc13
1 files changed, 13 insertions, 0 deletions
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;
}