| OLD | NEW |
| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "chrome/test/ui/ui_test.h" | 7 #include "chrome/test/ui/ui_test.h" |
| 8 | 8 |
| 9 class ImagesTest : public UITest { | 9 class ImagesTest : public UITest { |
| 10 protected: | 10 protected: |
| 11 ImagesTest() : UITest() { | 11 ImagesTest() : UITest() { |
| 12 launch_arguments_ = test_data_directory_; | 12 std::wstring path = test_data_directory_; |
| 13 file_util::AppendToPath(&launch_arguments_, L"animated-gifs.html"); | 13 file_util::AppendToPath(&path, L"animated-gifs.html"); |
| 14 launch_arguments_ = CommandLine(L""); |
| 15 launch_arguments_.AppendLooseValue(path); |
| 14 } | 16 } |
| 15 }; | 17 }; |
| 16 | 18 |
| 17 TEST_F(ImagesTest, AnimatedGIFs) { | 19 TEST_F(ImagesTest, AnimatedGIFs) { |
| 18 std::wstring page_title = L"animated gif test"; | 20 std::wstring page_title = L"animated gif test"; |
| 19 | 21 |
| 20 // Let the GIFs fully animate. | 22 // Let the GIFs fully animate. |
| 21 for (int i = 0; i < 10; ++i) { | 23 for (int i = 0; i < 10; ++i) { |
| 22 Sleep(sleep_timeout_ms()); | 24 Sleep(sleep_timeout_ms()); |
| 23 if (page_title == GetActiveTabTitle()) | 25 if (page_title == GetActiveTabTitle()) |
| 24 break; | 26 break; |
| 25 } | 27 } |
| 26 | 28 |
| 27 // Make sure the navigation succeeded. | 29 // Make sure the navigation succeeded. |
| 28 EXPECT_EQ(page_title, GetActiveTabTitle()); | 30 EXPECT_EQ(page_title, GetActiveTabTitle()); |
| 29 | 31 |
| 30 // Tau will check if this crashed. | 32 // Tau will check if this crashed. |
| 31 } | 33 } |
| 32 | 34 |
| OLD | NEW |