OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/in_process_browser_test.h" | 5 #include "chrome/test/in_process_browser_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "chrome/common/notification_type.h" | 35 #include "chrome/common/notification_type.h" |
36 #include "chrome/common/url_constants.h" | 36 #include "chrome/common/url_constants.h" |
37 #include "chrome/test/test_launcher_utils.h" | 37 #include "chrome/test/test_launcher_utils.h" |
38 #include "chrome/test/testing_browser_process.h" | 38 #include "chrome/test/testing_browser_process.h" |
39 #include "chrome/test/ui_test_utils.h" | 39 #include "chrome/test/ui_test_utils.h" |
40 #include "net/base/mock_host_resolver.h" | 40 #include "net/base/mock_host_resolver.h" |
41 #include "net/test/test_server.h" | 41 #include "net/test/test_server.h" |
42 #include "sandbox/src/dep.h" | 42 #include "sandbox/src/dep.h" |
43 | 43 |
44 #if defined(OS_MACOSX) | 44 #if defined(OS_MACOSX) |
45 #include "base/mac_util.h" | 45 #include "base/mac/mac_util.h" |
46 #endif | 46 #endif |
47 | 47 |
48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
49 #include "chrome/browser/views/frame/browser_view.h" | 49 #include "chrome/browser/views/frame/browser_view.h" |
50 #endif | 50 #endif |
51 | 51 |
52 namespace { | 52 namespace { |
53 | 53 |
54 void InitializeBrowser(Browser* browser) { | 54 void InitializeBrowser(Browser* browser) { |
55 browser->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL), | 55 browser->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL), |
(...skipping 15 matching lines...) Expand all Loading... |
71 // Passed as value of kTestType. | 71 // Passed as value of kTestType. |
72 static const char kBrowserTestType[] = "browser"; | 72 static const char kBrowserTestType[] = "browser"; |
73 | 73 |
74 InProcessBrowserTest::InProcessBrowserTest() | 74 InProcessBrowserTest::InProcessBrowserTest() |
75 : browser_(NULL), | 75 : browser_(NULL), |
76 show_window_(false), | 76 show_window_(false), |
77 dom_automation_enabled_(false), | 77 dom_automation_enabled_(false), |
78 tab_closeable_state_watcher_enabled_(false), | 78 tab_closeable_state_watcher_enabled_(false), |
79 original_single_process_(false) { | 79 original_single_process_(false) { |
80 #if defined(OS_MACOSX) | 80 #if defined(OS_MACOSX) |
81 mac_util::SetOverrideAmIBundled(true); | 81 base::mac::SetOverrideAmIBundled(true); |
82 #endif | 82 #endif |
83 | 83 |
84 // Before we run the browser, we have to hack the path to the exe to match | 84 // Before we run the browser, we have to hack the path to the exe to match |
85 // what it would be if Chrome was running, because it is used to fork renderer | 85 // what it would be if Chrome was running, because it is used to fork renderer |
86 // processes, on Linux at least (failure to do so will cause a browser_test to | 86 // processes, on Linux at least (failure to do so will cause a browser_test to |
87 // be run instead of a renderer). | 87 // be run instead of a renderer). |
88 FilePath chrome_path; | 88 FilePath chrome_path; |
89 CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); | 89 CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); |
90 chrome_path = chrome_path.DirName(); | 90 chrome_path = chrome_path.DirName(); |
91 chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); | 91 chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 return; | 338 return; |
339 | 339 |
340 // Invoke CloseAllBrowsersAndExit on a running message loop. | 340 // Invoke CloseAllBrowsersAndExit on a running message loop. |
341 // CloseAllBrowsersAndExit exits the message loop after everything has been | 341 // CloseAllBrowsersAndExit exits the message loop after everything has been |
342 // shut down properly. | 342 // shut down properly. |
343 MessageLoopForUI::current()->PostTask( | 343 MessageLoopForUI::current()->PostTask( |
344 FROM_HERE, | 344 FROM_HERE, |
345 NewRunnableFunction(&BrowserList::CloseAllBrowsersAndExit)); | 345 NewRunnableFunction(&BrowserList::CloseAllBrowsersAndExit)); |
346 ui_test_utils::RunMessageLoop(); | 346 ui_test_utils::RunMessageLoop(); |
347 } | 347 } |
OLD | NEW |