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); |
70 | 77 |
71 base::ProcessHandle handle; | 78 base::ProcessHandle handle; |
72 bool launched = | 79 bool launched = |
73 base::LaunchProcess(new_command_line, base::LaunchOptionsForTest(), | 80 base::LaunchProcess(new_command_line, base::LaunchOptionsForTest(), |
74 &handle); | 81 &handle); |
75 EXPECT_TRUE(launched); | 82 EXPECT_TRUE(launched); |
76 | 83 |
77 int exit_code = -100; | 84 int exit_code = -100; |
78 bool exited = | 85 bool exited = |
79 base::WaitForExitCodeWithTimeout(handle, &exit_code, | 86 base::WaitForExitCodeWithTimeout(handle, &exit_code, |
80 TestTimeouts::action_timeout()); | 87 TestTimeouts::action_timeout()); |
81 | 88 |
82 EXPECT_TRUE(exited); | 89 EXPECT_TRUE(exited); |
83 EXPECT_EQ(content::RESULT_CODE_NORMAL_EXIT, exit_code); | 90 EXPECT_EQ(content::RESULT_CODE_NORMAL_EXIT, exit_code); |
84 base::CloseProcessHandle(handle); | 91 base::CloseProcessHandle(handle); |
85 } | 92 } |
86 | 93 |
87 } // namespace | 94 } // namespace |
OLD | NEW |