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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // http://code.google.com/p/chromium/issues/detail?id=14774 | 27 // http://code.google.com/p/chromium/issues/detail?id=14774 |
28 #if defined(OS_WIN) && !defined(NDEBUG) | 28 #if defined(OS_WIN) && !defined(NDEBUG) |
29 #define MAYBE_CloseTab DISABLED_CloseTab | 29 #define MAYBE_CloseTab DISABLED_CloseTab |
30 #define MAYBE_CloseBrowserWindow DISABLED_CloseBrowserWindow | 30 #define MAYBE_CloseBrowserWindow DISABLED_CloseBrowserWindow |
31 #else | 31 #else |
32 #define MAYBE_CloseTab CloseTab | 32 #define MAYBE_CloseTab CloseTab |
33 #define MAYBE_CloseBrowserWindow CloseBrowserWindow | 33 #define MAYBE_CloseBrowserWindow CloseBrowserWindow |
34 #endif | 34 #endif |
35 | 35 |
| 36 // TODO(phajdan.jr): Enable FindInPageTest on Mac. |
| 37 #if !defined(OS_MACOSX) |
36 TEST_F(AutomatedUITestBase, FindInPage) { | 38 TEST_F(AutomatedUITestBase, FindInPage) { |
37 ASSERT_TRUE(FindInPage()); | 39 ASSERT_TRUE(FindInPage()); |
38 bool is_visible; | 40 bool is_visible; |
39 ASSERT_TRUE(active_browser()->IsFindWindowFullyVisible(&is_visible)); | 41 ASSERT_TRUE(active_browser()->IsFindWindowFullyVisible(&is_visible)); |
40 EXPECT_TRUE(is_visible); | 42 EXPECT_TRUE(is_visible); |
41 } | 43 } |
| 44 #endif // !defined(OS_MACOSX) |
42 | 45 |
43 TEST_F(AutomatedUITestBase, Home) { | 46 TEST_F(AutomatedUITestBase, Home) { |
44 FilePath path_prefix(test_data_directory_.AppendASCII("session_history")); | 47 FilePath path_prefix(test_data_directory_.AppendASCII("session_history")); |
45 GURL bot1(net::FilePathToFileURL(path_prefix.AppendASCII("bot1.html"))); | 48 GURL bot1(net::FilePathToFileURL(path_prefix.AppendASCII("bot1.html"))); |
46 NavigateToURL(bot1); // To help verify that Home does something. | 49 NavigateToURL(bot1); // To help verify that Home does something. |
47 | 50 |
48 ASSERT_TRUE(Home()); | 51 ASSERT_TRUE(Home()); |
49 | 52 |
50 GURL url; | 53 GURL url; |
51 ASSERT_TRUE(active_browser()->GetActiveTab()->GetCurrentURL(&url)); | 54 ASSERT_TRUE(active_browser()->GetActiveTab()->GetCurrentURL(&url)); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 352 |
350 ASSERT_TRUE(SelectPreviousTab()); | 353 ASSERT_TRUE(SelectPreviousTab()); |
351 ASSERT_TRUE(active_browser()->GetActiveTabIndex(&active_tab_index)); | 354 ASSERT_TRUE(active_browser()->GetActiveTabIndex(&active_tab_index)); |
352 ASSERT_EQ(1, active_tab_index); | 355 ASSERT_EQ(1, active_tab_index); |
353 | 356 |
354 ASSERT_TRUE(SelectNextTab()); | 357 ASSERT_TRUE(SelectNextTab()); |
355 ASSERT_TRUE(active_browser()->GetActiveTabIndex(&active_tab_index)); | 358 ASSERT_TRUE(active_browser()->GetActiveTabIndex(&active_tab_index)); |
356 ASSERT_EQ(2, active_tab_index); | 359 ASSERT_EQ(2, active_tab_index); |
357 } | 360 } |
358 | 361 |
| 362 // TODO(phajdan.jr): Enable ShowBookmarkBar on Mac. |
| 363 #if !defined(OS_MACOSX) |
359 TEST_F(AutomatedUITestBase, ShowBookmarkBar) { | 364 TEST_F(AutomatedUITestBase, ShowBookmarkBar) { |
360 ASSERT_TRUE(ShowBookmarkBar()); | 365 ASSERT_TRUE(ShowBookmarkBar()); |
361 bool is_visible; | 366 bool is_visible; |
362 bool is_animating; | 367 bool is_animating; |
363 ASSERT_TRUE(active_browser()->GetBookmarkBarVisibility(&is_visible, | 368 ASSERT_TRUE(active_browser()->GetBookmarkBarVisibility(&is_visible, |
364 &is_animating)); | 369 &is_animating)); |
365 ASSERT_TRUE(is_visible); | 370 ASSERT_TRUE(is_visible); |
366 ASSERT_FALSE(is_animating); | 371 ASSERT_FALSE(is_animating); |
367 | 372 |
368 // Try second time to make sure it won't make the bookmark bar | 373 // Try second time to make sure it won't make the bookmark bar |
369 // disappear. | 374 // disappear. |
370 ASSERT_TRUE(ShowBookmarkBar()); | 375 ASSERT_TRUE(ShowBookmarkBar()); |
371 ASSERT_TRUE(active_browser()->GetBookmarkBarVisibility(&is_visible, | 376 ASSERT_TRUE(active_browser()->GetBookmarkBarVisibility(&is_visible, |
372 &is_animating)); | 377 &is_animating)); |
373 ASSERT_TRUE(is_visible); | 378 ASSERT_TRUE(is_visible); |
374 ASSERT_FALSE(is_animating); | 379 ASSERT_FALSE(is_animating); |
375 } | 380 } |
| 381 #endif // !defined(OS_MACOSX) |
376 | 382 |
377 TEST_F(AutomatedUITestBase, ShowDownloads) { | 383 TEST_F(AutomatedUITestBase, ShowDownloads) { |
378 ASSERT_TRUE(ShowDownloads()); | 384 ASSERT_TRUE(ShowDownloads()); |
379 GURL url; | 385 GURL url; |
380 ASSERT_TRUE(GetActiveTab()->GetCurrentURL(&url)); | 386 ASSERT_TRUE(GetActiveTab()->GetCurrentURL(&url)); |
381 ASSERT_EQ(GURL(chrome::kChromeUIDownloadsURL), url); | 387 ASSERT_EQ(GURL(chrome::kChromeUIDownloadsURL), url); |
382 } | 388 } |
383 | 389 |
384 TEST_F(AutomatedUITestBase, ShowHistory) { | 390 TEST_F(AutomatedUITestBase, ShowHistory) { |
385 ASSERT_TRUE(ShowHistory()); | 391 ASSERT_TRUE(ShowHistory()); |
386 GURL url; | 392 GURL url; |
387 ASSERT_TRUE(GetActiveTab()->GetCurrentURL(&url)); | 393 ASSERT_TRUE(GetActiveTab()->GetCurrentURL(&url)); |
388 ASSERT_EQ(GURL(chrome::kChromeUIHistoryURL), url); | 394 ASSERT_EQ(GURL(chrome::kChromeUIHistoryURL), url); |
389 } | 395 } |
OLD | NEW |