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