Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/test/base/in_process_browser_test.h" | 5 #include "chrome/test/base/in_process_browser_test.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 // Before we run the browser, we have to hack the path to the exe to match | 72 // Before we run the browser, we have to hack the path to the exe to match |
| 73 // what it would be if Chrome was running, because it is used to fork renderer | 73 // what it would be if Chrome was running, because it is used to fork renderer |
| 74 // processes, on Linux at least (failure to do so will cause a browser_test to | 74 // processes, on Linux at least (failure to do so will cause a browser_test to |
| 75 // be run instead of a renderer). | 75 // be run instead of a renderer). |
| 76 FilePath chrome_path; | 76 FilePath chrome_path; |
| 77 CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); | 77 CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); |
| 78 chrome_path = chrome_path.DirName(); | 78 chrome_path = chrome_path.DirName(); |
| 79 chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); | 79 chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); |
| 80 CHECK(PathService::Override(base::FILE_EXE, chrome_path)); | 80 CHECK(PathService::Override(base::FILE_EXE, chrome_path)); |
| 81 #endif // defined(OS_MACOSX) | 81 #endif // defined(OS_MACOSX) |
| 82 CreateTestServer("chrome/test/data"); | 82 CreateTestServer(FilePath(FILE_PATH_LITERAL("chrome")) |
| 83 .Append(FILE_PATH_LITERAL("test")) | |
| 84 .Append(FILE_PATH_LITERAL("data"))); | |
|
Ryan Sleevi
2012/10/10 17:38:40
FILE_PATH_LITERAL("chrome/test/data") ?
Takashi Toyoshima
2012/10/11 03:55:37
Done.
| |
| 83 } | 85 } |
| 84 | 86 |
| 85 InProcessBrowserTest::~InProcessBrowserTest() { | 87 InProcessBrowserTest::~InProcessBrowserTest() { |
| 86 } | 88 } |
| 87 | 89 |
| 88 void InProcessBrowserTest::SetUp() { | 90 void InProcessBrowserTest::SetUp() { |
| 89 // Undo TestingBrowserProcess creation in ChromeTestSuite. | 91 // Undo TestingBrowserProcess creation in ChromeTestSuite. |
| 90 // TODO(phajdan.jr): Extract a smaller test suite so we don't need this. | 92 // TODO(phajdan.jr): Extract a smaller test suite so we don't need this. |
| 91 DCHECK(g_browser_process); | 93 DCHECK(g_browser_process); |
| 92 delete g_browser_process; | 94 delete g_browser_process; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 // On the Mac, this eventually reaches | 373 // On the Mac, this eventually reaches |
| 372 // -[BrowserWindowController windowWillClose:], which will post a deferred | 374 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 373 // -autorelease on itself to ultimately destroy the Browser object. The line | 375 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 374 // below is necessary to pump these pending messages to ensure all Browsers | 376 // below is necessary to pump these pending messages to ensure all Browsers |
| 375 // get deleted. | 377 // get deleted. |
| 376 content::RunAllPendingInMessageLoop(); | 378 content::RunAllPendingInMessageLoop(); |
| 377 delete autorelease_pool_; | 379 delete autorelease_pool_; |
| 378 autorelease_pool_ = NULL; | 380 autorelease_pool_ = NULL; |
| 379 #endif | 381 #endif |
| 380 } | 382 } |
| OLD | NEW |