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

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

Issue 39257: Add regression test for bug 7900 and necessary infrastructure.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/automation/automation_proxy.h » ('j') | 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/common/chrome_constants.h"
6 #include "chrome/test/ui/ui_test.h" 5 #include "chrome/test/ui/ui_test.h"
7 6
7 #include "base/command_line.h"
8 #include "base/file_path.h"
9 #include "base/file_util.h"
10 #include "net/base/net_util.h"
11
8 typedef UITest ChromeMainTest; 12 typedef UITest ChromeMainTest;
9 13
10 // Launch the app, then close the app. 14 // Launch the app, then close the app.
11 TEST_F(ChromeMainTest, AppLaunch) { 15 TEST_F(ChromeMainTest, AppLaunch) {
12 // If we make it here at all, we've succeeded in retrieving the app window 16 // If we make it here at all, we've succeeded in retrieving the app window
13 // in UITest::SetUp()--otherwise we'd fail with an exception in SetUp(). 17 // in UITest::SetUp()--otherwise we'd fail with an exception in SetUp().
14 18
15 if (UITest::in_process_renderer()) { 19 if (UITest::in_process_renderer()) {
16 EXPECT_EQ(1, UITest::GetBrowserProcessCount()); 20 EXPECT_EQ(1, UITest::GetBrowserProcessCount());
17 } else { 21 } else {
(...skipping 19 matching lines...) Expand all
37 use_existing_browser_ = true; 41 use_existing_browser_ = true;
38 42
39 LaunchBrowser(CommandLine(L""), false); 43 LaunchBrowser(CommandLine(L""), false);
40 44
41 int window_count; 45 int window_count;
42 ASSERT_TRUE(automation()->WaitForWindowCountToChange(1, &window_count, 46 ASSERT_TRUE(automation()->WaitForWindowCountToChange(1, &window_count,
43 action_timeout_ms())); 47 action_timeout_ms()));
44 ASSERT_EQ(2, window_count); 48 ASSERT_EQ(2, window_count);
45 } 49 }
46 50
51 TEST_F(ChromeMainTest, ReuseBrowserInstanceWhenOpeningFile) {
52 include_testing_id_ = false;
53 use_existing_browser_ = true;
54
55 std::wstring test_file = test_data_directory_;
56 file_util::AppendToPath(&test_file, L"empty.html");
57
58 CommandLine command_line(L"");
59 command_line.AppendLooseValue(test_file);
60
61 LaunchBrowser(command_line, false);
62
63 FilePath test_file_path(FilePath::FromWStringHack(test_file));
64
65 ASSERT_TRUE(automation()->WaitForURLDisplayed(
66 net::FilePathToFileURL(test_file_path), action_timeout_ms()));
Nicolas Sylvain 2009/03/06 20:50:46 did we understand why it's creating a window inste
67 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/automation/automation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698