cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / printing / cloud_print / test / cloud_print_policy_browsertest.cc
blob29e8c25b53975307cc2d3fb4be96dbd2d48b94f0
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
3 // found in the LICENSE file.
5 #include "base/command_line.h"
6 #include "base/process/kill.h"
7 #include "base/process/launch.h"
8 #include "base/test/test_timeouts.h"
9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/common/chrome_result_codes.h"
11 #include "chrome/common/chrome_switches.h"
12 #include "chrome/test/base/in_process_browser_test.h"
13 #include "chrome/test/base/test_switches.h"
14 #include "chrome/test/base/ui_test_utils.h"
15 #include "content/public/browser/notification_service.h"
16 #include "content/public/common/result_codes.h"
18 // These tests don't apply to the Mac version; see GetCommandLineForRelaunch
19 // for details.
20 #if defined(OS_MACOSX)
21 #error This test file should not be part of the Mac build.
22 #endif
24 namespace {
26 class CloudPrintPolicyTest : public InProcessBrowserTest {
27 public:
28 CloudPrintPolicyTest() {}
31 IN_PROC_BROWSER_TEST_F(CloudPrintPolicyTest, NormalPassedFlag) {
32 #if defined(OS_WIN) && defined(USE_ASH)
33 // Disable this test in Metro+Ash for now (http://crbug.com/262796).
34 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
35 switches::kAshBrowserTests))
36 return;
37 #endif
39 base::FilePath test_file_path = ui_test_utils::GetTestFilePath(
40 base::FilePath(), base::FilePath().AppendASCII("empty.html"));
41 base::CommandLine new_command_line(GetCommandLineForRelaunch());
42 new_command_line.AppendArgPath(test_file_path);
44 content::WindowedNotificationObserver observer(
45 chrome::NOTIFICATION_TAB_ADDED,
46 content::NotificationService::AllSources());
48 base::Process process =
49 base::LaunchProcess(new_command_line, base::LaunchOptionsForTest());
50 EXPECT_TRUE(process.IsValid());
52 observer.Wait();
54 int exit_code = -100;
55 bool exited = process.WaitForExitWithTimeout(TestTimeouts::action_timeout(),
56 &exit_code);
57 EXPECT_TRUE(exited);
58 EXPECT_EQ(chrome::RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED, exit_code);
61 } // namespace