OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/app/chrome_dll_resource.h" | 5 #include "chrome/app/chrome_dll_resource.h" |
6 #include "chrome/common/url_constants.h" | 6 #include "chrome/common/url_constants.h" |
7 #include "chrome/test/automated_ui_tests/automated_ui_test_base.h" | 7 #include "chrome/test/automated_ui_tests/automated_ui_test_base.h" |
8 #include "chrome/test/automation/browser_proxy.h" | 8 #include "chrome/test/automation/browser_proxy.h" |
9 #include "chrome/test/automation/tab_proxy.h" | 9 #include "chrome/test/automation/tab_proxy.h" |
10 #include "chrome/test/ui/ui_test.h" | 10 #include "chrome/test/ui/ui_test.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
12 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
13 | 13 |
14 #if defined(OS_MACOSX) | 14 #if defined(OS_MACOSX) |
15 // The window pops up, but doesn't close. | 15 // The window pops up, but doesn't close. |
16 #define MAYBE_IncognitoWindow DISABLED_IncognitoWindow | 16 #define MAYBE_IncognitoWindow DISABLED_IncognitoWindow |
17 #define MAYBE_OpenCloseBrowserWindowWithAccelerator \ | 17 #define MAYBE_OpenCloseBrowserWindowWithAccelerator \ |
18 DISABLED_OpenCloseBrowserWindowWithAccelerator | 18 DISABLED_OpenCloseBrowserWindowWithAccelerator |
19 #else | 19 #else |
20 // http://code.google.com/p/chromium/issues/detail?id=14731 | 20 // http://code.google.com/p/chromium/issues/detail?id=14731 |
21 #define MAYBE_IncognitoWindow DISABLED_IncognitoWindow | 21 #define MAYBE_IncognitoWindow DISABLED_IncognitoWindow |
22 // http://crbug.com/19394 | 22 // http://crbug.com/19394 |
23 #define MAYBE_OpenCloseBrowserWindowWithAccelerator \ | 23 #define MAYBE_OpenCloseBrowserWindowWithAccelerator \ |
24 DISABLED_OpenCloseBrowserWindowWithAccelerator | 24 DISABLED_OpenCloseBrowserWindowWithAccelerator |
25 #endif | 25 #endif |
26 | 26 |
27 // http://code.google.com/p/chromium/issues/detail?id=14774 | |
28 #if defined(OS_WIN) && !defined(NDEBUG) | |
29 #define MAYBE_CloseTab DISABLED_CloseTab | |
30 #else | |
31 #define MAYBE_CloseTab CloseTab | |
32 #endif | |
33 | |
34 // Automation pieces are not implemented for these on platforms other than | 27 // Automation pieces are not implemented for these on platforms other than |
35 // Windows. | 28 // Windows. |
36 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
37 #define MAYBE_ShowBookmarkBar ShowBookmarkBar | 30 #define MAYBE_ShowBookmarkBar ShowBookmarkBar |
38 #else | 31 #else |
39 #define MAYBE_ShowBookmarkBar DISABLED_ShowBookmarkBar | 32 #define MAYBE_ShowBookmarkBar DISABLED_ShowBookmarkBar |
40 #endif | 33 #endif |
41 | 34 |
42 // FindBarTesting not implemented on mac. | 35 // FindBarTesting not implemented on mac. |
43 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 GURL test_url = net::FilePathToFileURL(path_prefix.AppendASCII("bot1.html")); | 97 GURL test_url = net::FilePathToFileURL(path_prefix.AppendASCII("bot1.html")); |
105 GetActiveTab()->NavigateToURL(test_url); | 98 GetActiveTab()->NavigateToURL(test_url); |
106 CloseActiveTab(); | 99 CloseActiveTab(); |
107 active_browser()->GetTabCount(&tab_count); | 100 active_browser()->GetTabCount(&tab_count); |
108 ASSERT_EQ(1, tab_count); | 101 ASSERT_EQ(1, tab_count); |
109 RestoreTab(); | 102 RestoreTab(); |
110 active_browser()->GetTabCount(&tab_count); | 103 active_browser()->GetTabCount(&tab_count); |
111 ASSERT_EQ(2, tab_count); | 104 ASSERT_EQ(2, tab_count); |
112 } | 105 } |
113 | 106 |
114 TEST_F(AutomatedUITestBase, MAYBE_CloseTab) { | 107 // http://code.google.com/p/chromium/issues/detail?id=14774 |
| 108 TEST_F(AutomatedUITestBase, FLAKY_CloseTab) { |
115 int num_browser_windows; | 109 int num_browser_windows; |
116 int tab_count; | 110 int tab_count; |
117 NewTab(); | 111 NewTab(); |
118 ASSERT_TRUE(automation()->GetBrowserWindowCount(&num_browser_windows)); | 112 ASSERT_TRUE(automation()->GetBrowserWindowCount(&num_browser_windows)); |
119 ASSERT_EQ(1, num_browser_windows); | 113 ASSERT_EQ(1, num_browser_windows); |
120 active_browser()->GetTabCount(&tab_count); | 114 active_browser()->GetTabCount(&tab_count); |
121 ASSERT_EQ(2, tab_count); | 115 ASSERT_EQ(2, tab_count); |
122 | 116 |
123 ASSERT_TRUE(OpenAndActivateNewBrowserWindow(NULL)); | 117 ASSERT_TRUE(OpenAndActivateNewBrowserWindow(NULL)); |
124 NewTab(); | 118 NewTab(); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 ASSERT_TRUE(GetActiveTab()->GetCurrentURL(&url)); | 388 ASSERT_TRUE(GetActiveTab()->GetCurrentURL(&url)); |
395 ASSERT_EQ(GURL(chrome::kChromeUIDownloadsURL), url); | 389 ASSERT_EQ(GURL(chrome::kChromeUIDownloadsURL), url); |
396 } | 390 } |
397 | 391 |
398 TEST_F(AutomatedUITestBase, ShowHistory) { | 392 TEST_F(AutomatedUITestBase, ShowHistory) { |
399 ASSERT_TRUE(ShowHistory()); | 393 ASSERT_TRUE(ShowHistory()); |
400 GURL url; | 394 GURL url; |
401 ASSERT_TRUE(GetActiveTab()->GetCurrentURL(&url)); | 395 ASSERT_TRUE(GetActiveTab()->GetCurrentURL(&url)); |
402 ASSERT_EQ(GURL(chrome::kChromeUIHistoryURL), url); | 396 ASSERT_EQ(GURL(chrome::kChromeUIHistoryURL), url); |
403 } | 397 } |
OLD | NEW |