Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: chrome/app/chrome_main_uitest.cc

Issue 40301: Make SecondLaunch UI test not-flaky by using more reliable (Closed)
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/ui/ui_test.h" 5 #include "chrome/test/ui/ui_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 "net/base/net_util.h" 10 #include "net/base/net_util.h"
(...skipping 17 matching lines...) Expand all
28 // Make sure that the testing interface is there and giving reasonable answers. 28 // Make sure that the testing interface is there and giving reasonable answers.
29 TEST_F(ChromeMainTest, AppTestingInterface) { 29 TEST_F(ChromeMainTest, AppTestingInterface) {
30 int window_count = 0; 30 int window_count = 0;
31 EXPECT_TRUE(automation()->GetBrowserWindowCount(&window_count)); 31 EXPECT_TRUE(automation()->GetBrowserWindowCount(&window_count));
32 EXPECT_EQ(1, window_count); 32 EXPECT_EQ(1, window_count);
33 33
34 EXPECT_EQ(1, GetTabCount()); 34 EXPECT_EQ(1, GetTabCount());
35 } 35 }
36 36
37 // Make sure that the second invocation creates a new window. 37 // Make sure that the second invocation creates a new window.
38 // This test is disabled. See bug 5671. 38 TEST_F(ChromeMainTest, SecondLaunch) {
39 TEST_F(ChromeMainTest, DISABLED_SecondLaunch) {
40 include_testing_id_ = false; 39 include_testing_id_ = false;
41 use_existing_browser_ = true; 40 use_existing_browser_ = true;
42 41
43 LaunchBrowser(CommandLine(L""), false); 42 LaunchBrowser(CommandLine(L""), false);
44 43
45 int window_count; 44 ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, action_timeout_ms()));
46 ASSERT_TRUE(automation()->WaitForWindowCountToChange(1, &window_count,
47 action_timeout_ms()));
48 ASSERT_EQ(2, window_count);
49 } 45 }
50 46
51 TEST_F(ChromeMainTest, ReuseBrowserInstanceWhenOpeningFile) { 47 TEST_F(ChromeMainTest, ReuseBrowserInstanceWhenOpeningFile) {
52 include_testing_id_ = false; 48 include_testing_id_ = false;
53 use_existing_browser_ = true; 49 use_existing_browser_ = true;
54 50
55 std::wstring test_file = test_data_directory_; 51 std::wstring test_file = test_data_directory_;
56 file_util::AppendToPath(&test_file, L"empty.html"); 52 file_util::AppendToPath(&test_file, L"empty.html");
57 53
58 CommandLine command_line(L""); 54 CommandLine command_line(L"");
59 command_line.AppendLooseValue(test_file); 55 command_line.AppendLooseValue(test_file);
60 56
61 LaunchBrowser(command_line, false); 57 LaunchBrowser(command_line, false);
62 58
63 FilePath test_file_path(FilePath::FromWStringHack(test_file)); 59 FilePath test_file_path(FilePath::FromWStringHack(test_file));
64 60
65 ASSERT_TRUE(automation()->WaitForURLDisplayed( 61 ASSERT_TRUE(automation()->WaitForURLDisplayed(
66 net::FilePathToFileURL(test_file_path), action_timeout_ms())); 62 net::FilePathToFileURL(test_file_path), action_timeout_ms()));
67 } 63 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698