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_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 ASSERT_FALSE(errors[0].compare(expected_error)); | 311 ASSERT_FALSE(errors[0].compare(expected_error)); |
312 } | 312 } |
313 | 313 |
314 // Test that PageCycler will visit all the urls from a cache directory | 314 // Test that PageCycler will visit all the urls from a cache directory |
315 // successfully while in playback mode. | 315 // successfully while in playback mode. |
316 #if defined(OS_CHROMEOS) | 316 #if defined(OS_CHROMEOS) |
317 // TODO(rdevlin.cronin): Perhaps page cycler isn't completely implemented on | 317 // TODO(rdevlin.cronin): Perhaps page cycler isn't completely implemented on |
318 // ChromeOS? | 318 // ChromeOS? |
319 #else | 319 #else |
320 // Bug 131333: This test fails on a XP debug bot since Build 17609. | 320 // Bug 131333: This test fails on a XP debug bot since Build 17609. |
321 #if defined(OS_WIN) && !defined(NDEBUG) | 321 #if (defined(OS_WIN) || defined(OS_MACOSX)) && !defined(NDEBUG) |
322 #define MAYBE_PlaybackMode DISABLED_PlaybackMode | 322 #define MAYBE_PlaybackMode DISABLED_PlaybackMode |
323 #else | 323 #else |
324 #define MAYBE_PlaybackMode PlaybackMode | 324 #define MAYBE_PlaybackMode PlaybackMode |
325 #endif | 325 #endif |
326 IN_PROC_BROWSER_TEST_F(PageCyclerCachedBrowserTest, MAYBE_PlaybackMode) { | 326 IN_PROC_BROWSER_TEST_F(PageCyclerCachedBrowserTest, MAYBE_PlaybackMode) { |
327 ScopedTempDir temp; | 327 ScopedTempDir temp; |
328 ASSERT_TRUE(temp.CreateUniqueTempDir()); | 328 ASSERT_TRUE(temp.CreateUniqueTempDir()); |
329 | 329 |
330 RegisterForNotifications(); | 330 RegisterForNotifications(); |
331 InitFilePaths(temp.path()); | 331 InitFilePaths(temp.path()); |
332 | 332 |
333 InitPageCycler(); | 333 InitPageCycler(); |
334 | 334 |
335 page_cycler()->Run(); | 335 page_cycler()->Run(); |
336 | 336 |
337 ui_test_utils::RunMessageLoop(); | 337 ui_test_utils::RunMessageLoop(); |
338 ASSERT_TRUE(file_util::PathExists(stats_file())); | 338 ASSERT_TRUE(file_util::PathExists(stats_file())); |
339 ASSERT_FALSE(file_util::PathExists(errors_file())); | 339 ASSERT_FALSE(file_util::PathExists(errors_file())); |
340 } | 340 } |
341 | 341 |
342 // Test that PageCycler will have a cache miss if a URL is missing from the | 342 // Test that PageCycler will have a cache miss if a URL is missing from the |
343 // cache directory while in playback mode. | 343 // cache directory while in playback mode. |
344 // Bug 131333: This test fails on a XP debug bot since Build 17609. | 344 // Bug 131333: This test fails on a XP debug bot since Build 17609. |
345 #if defined(OS_WIN) && !defined(NDEBUG) | 345 #if (defined(OS_WIN) || defined(OS_MACOSX)) && !defined(NDEBUG) |
346 #define MAYBE_URLNotInCache DISABLED_URLNotInCache | 346 #define MAYBE_URLNotInCache DISABLED_URLNotInCache |
347 #else | 347 #else |
348 #define MAYBE_URLNotInCache URLNotInCache | 348 #define MAYBE_URLNotInCache URLNotInCache |
349 #endif | 349 #endif |
350 IN_PROC_BROWSER_TEST_F(PageCyclerCachedBrowserTest, MAYBE_URLNotInCache) { | 350 IN_PROC_BROWSER_TEST_F(PageCyclerCachedBrowserTest, MAYBE_URLNotInCache) { |
351 const char kCacheMissURL[] = "http://www.images.google.com/"; | 351 const char kCacheMissURL[] = "http://www.images.google.com/"; |
352 | 352 |
353 ScopedTempDir temp; | 353 ScopedTempDir temp; |
354 ASSERT_TRUE(temp.CreateUniqueTempDir()); | 354 ASSERT_TRUE(temp.CreateUniqueTempDir()); |
355 | 355 |
(...skipping 22 matching lines...) Expand all Loading... |
378 ASSERT_EQ(1u, errors.size()); | 378 ASSERT_EQ(1u, errors.size()); |
379 | 379 |
380 std::string expected_error; | 380 std::string expected_error; |
381 expected_error.append("Failed to load the page at: ") | 381 expected_error.append("Failed to load the page at: ") |
382 .append(kCacheMissURL) | 382 .append(kCacheMissURL) |
383 .append(": The requested entry was not found in the cache."); | 383 .append(": The requested entry was not found in the cache."); |
384 | 384 |
385 ASSERT_FALSE(errors[0].compare(expected_error)); | 385 ASSERT_FALSE(errors[0].compare(expected_error)); |
386 } | 386 } |
387 #endif | 387 #endif |
OLD | NEW |