| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/process/kill.h" | 7 #include "base/process/kill.h" |
| 8 #include "base/process/launch.h" | 8 #include "base/process/launch.h" |
| 9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 EXPECT_TRUE(exited); | 60 EXPECT_TRUE(exited); |
| 61 EXPECT_EQ(chrome::RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED, exit_code); | 61 EXPECT_EQ(chrome::RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED, exit_code); |
| 62 base::CloseProcessHandle(handle); | 62 base::CloseProcessHandle(handle); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Disabled due to http://crbug.com/144393. | 65 // Disabled due to http://crbug.com/144393. |
| 66 IN_PROC_BROWSER_TEST_F(CloudPrintPolicyTest, DISABLED_CloudPrintPolicyFlag) { | 66 IN_PROC_BROWSER_TEST_F(CloudPrintPolicyTest, DISABLED_CloudPrintPolicyFlag) { |
| 67 CommandLine new_command_line(GetCommandLineForRelaunch()); | 67 CommandLine new_command_line(GetCommandLineForRelaunch()); |
| 68 new_command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy); | 68 new_command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy); |
| 69 // This is important for the test as the way the browser process is launched | |
| 70 // here causes the predictor databases to be initialized multiple times. This | |
| 71 // is not an issue for production where the process is launched as a service | |
| 72 // and a Profile is not created. See http://crbug.com/140466 for more details. | |
| 73 new_command_line.AppendSwitchASCII( | |
| 74 switches::kSpeculativeResourcePrefetching, | |
| 75 switches::kSpeculativeResourcePrefetchingDisabled); | |
| 76 | 69 |
| 77 base::ProcessHandle handle; | 70 base::ProcessHandle handle; |
| 78 bool launched = | 71 bool launched = |
| 79 base::LaunchProcess(new_command_line, base::LaunchOptions(), &handle); | 72 base::LaunchProcess(new_command_line, base::LaunchOptions(), &handle); |
| 80 EXPECT_TRUE(launched); | 73 EXPECT_TRUE(launched); |
| 81 | 74 |
| 82 int exit_code = -100; | 75 int exit_code = -100; |
| 83 bool exited = | 76 bool exited = |
| 84 base::WaitForExitCodeWithTimeout(handle, &exit_code, | 77 base::WaitForExitCodeWithTimeout(handle, &exit_code, |
| 85 TestTimeouts::action_timeout()); | 78 TestTimeouts::action_timeout()); |
| 86 | 79 |
| 87 EXPECT_TRUE(exited); | 80 EXPECT_TRUE(exited); |
| 88 EXPECT_EQ(content::RESULT_CODE_NORMAL_EXIT, exit_code); | 81 EXPECT_EQ(content::RESULT_CODE_NORMAL_EXIT, exit_code); |
| 89 base::CloseProcessHandle(handle); | 82 base::CloseProcessHandle(handle); |
| 90 } | 83 } |
| 91 | 84 |
| 92 } // namespace | 85 } // namespace |
| OLD | NEW |