| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| 11 #include "base/threading/sequenced_worker_pool.h" | 11 #include "base/threading/sequenced_worker_pool.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/page_cycler/page_cycler.h" | 13 #include "chrome/browser/page_cycler/page_cycler.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/browser/ui/browser_list.h" | 16 #include "chrome/browser/ui/browser_list.h" |
| 17 #include "chrome/common/chrome_notification_types.h" | 17 #include "chrome/common/chrome_notification_types.h" |
| 18 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
| 19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/test/base/in_process_browser_test.h" | 20 #include "chrome/test/base/in_process_browser_test.h" |
| 21 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
| 22 #include "chrome/test/base/ui_test_utils.h" | 22 #include "chrome/test/base/ui_test_utils.h" |
| 23 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
| 24 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
| 25 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
| 26 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
| 27 #include "content/public/common/url_constants.h" | 27 #include "content/public/common/url_constants.h" |
| 28 #include "googleurl/src/gurl.h" | 28 #include "googleurl/src/gurl.h" |
| 29 | 29 |
| 30 // TODO(kbr): remove: http://crbug.com/222296 |
| 31 #if defined(OS_MACOSX) |
| 32 #import "base/mac/mac_util.h" |
| 33 #endif |
| 34 |
| 30 // Basic PageCyclerBrowserTest structure; used in testing most of PageCycler's | 35 // Basic PageCyclerBrowserTest structure; used in testing most of PageCycler's |
| 31 // functionality. | 36 // functionality. |
| 32 class PageCyclerBrowserTest : public content::NotificationObserver, | 37 class PageCyclerBrowserTest : public content::NotificationObserver, |
| 33 public InProcessBrowserTest { | 38 public InProcessBrowserTest { |
| 34 public: | 39 public: |
| 35 PageCyclerBrowserTest() : page_cycler_(NULL) { | 40 PageCyclerBrowserTest() : page_cycler_(NULL) { |
| 36 } | 41 } |
| 37 | 42 |
| 38 virtual ~PageCyclerBrowserTest() { | 43 virtual ~PageCyclerBrowserTest() { |
| 39 } | 44 } |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 #if defined(OS_LINUX) | 325 #if defined(OS_LINUX) |
| 321 // Bug 159026: Fails on Linux in both debug and release mode. | 326 // Bug 159026: Fails on Linux in both debug and release mode. |
| 322 #define MAYBE_PlaybackMode DISABLED_PlaybackMode | 327 #define MAYBE_PlaybackMode DISABLED_PlaybackMode |
| 323 #elif (defined(OS_WIN) || defined(OS_MACOSX) ) && !defined(NDEBUG) | 328 #elif (defined(OS_WIN) || defined(OS_MACOSX) ) && !defined(NDEBUG) |
| 324 // Bug 131333: This test fails on a XP debug bot since Build 17609. | 329 // Bug 131333: This test fails on a XP debug bot since Build 17609. |
| 325 #define MAYBE_PlaybackMode DISABLED_PlaybackMode | 330 #define MAYBE_PlaybackMode DISABLED_PlaybackMode |
| 326 #else | 331 #else |
| 327 #define MAYBE_PlaybackMode PlaybackMode | 332 #define MAYBE_PlaybackMode PlaybackMode |
| 328 #endif | 333 #endif |
| 329 IN_PROC_BROWSER_TEST_F(PageCyclerCachedBrowserTest, MAYBE_PlaybackMode) { | 334 IN_PROC_BROWSER_TEST_F(PageCyclerCachedBrowserTest, MAYBE_PlaybackMode) { |
| 335 #if defined(OS_MACOSX) |
| 336 // TODO(kbr): re-enable: http://crbug.com/222296 |
| 337 if (base::mac::IsOSMountainLionOrLater()) |
| 338 return; |
| 339 #endif |
| 340 |
| 330 base::ScopedTempDir temp; | 341 base::ScopedTempDir temp; |
| 331 ASSERT_TRUE(temp.CreateUniqueTempDir()); | 342 ASSERT_TRUE(temp.CreateUniqueTempDir()); |
| 332 | 343 |
| 333 RegisterForNotifications(); | 344 RegisterForNotifications(); |
| 334 InitFilePaths(temp.path()); | 345 InitFilePaths(temp.path()); |
| 335 | 346 |
| 336 InitPageCycler(); | 347 InitPageCycler(); |
| 337 | 348 |
| 338 page_cycler()->Run(); | 349 page_cycler()->Run(); |
| 339 | 350 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 ASSERT_EQ(1u, errors.size()); | 396 ASSERT_EQ(1u, errors.size()); |
| 386 | 397 |
| 387 std::string expected_error; | 398 std::string expected_error; |
| 388 expected_error.append("Failed to load the page at: ") | 399 expected_error.append("Failed to load the page at: ") |
| 389 .append(kCacheMissURL) | 400 .append(kCacheMissURL) |
| 390 .append(": The requested entry was not found in the cache."); | 401 .append(": The requested entry was not found in the cache."); |
| 391 | 402 |
| 392 ASSERT_FALSE(errors[0].compare(expected_error)); | 403 ASSERT_FALSE(errors[0].compare(expected_error)); |
| 393 } | 404 } |
| 394 #endif // !defined(OS_CHROMEOS) | 405 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |