Chromium Code Reviews| 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_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/platform_thread.h" | 7 #include "base/platform_thread.h" |
| 8 #include "net/base/net_util.h" | |
| 8 #include "chrome/test/ui/ui_test.h" | 9 #include "chrome/test/ui/ui_test.h" |
| 9 | 10 |
| 10 class ImagesTest : public UITest { | 11 class ImagesTest : public UITest { |
|
sky
2010/03/25 22:08:06
typedef UITest ImagesTest;
| |
| 11 protected: | |
| 12 ImagesTest() : UITest() { | |
| 13 FilePath path(test_data_directory_); | |
| 14 path = path.AppendASCII("animated-gifs.html"); | |
| 15 launch_arguments_ = CommandLine(CommandLine::ARGUMENTS_ONLY); | |
| 16 launch_arguments_.AppendLooseValue(path.ToWStringHack()); | |
| 17 } | |
| 18 }; | 12 }; |
| 19 | 13 |
| 20 TEST_F(ImagesTest, AnimatedGIFs) { | 14 TEST_F(ImagesTest, AnimatedGIFs) { |
| 21 std::wstring page_title = L"animated gif test"; | 15 FilePath test_file(test_data_directory_); |
| 16 test_file = test_file.AppendASCII("animated-gifs.html"); | |
| 17 NavigateToURL(net::FilePathToFileURL(test_file)); | |
| 22 | 18 |
| 23 // Let the GIFs fully animate. | 19 // Let the GIFs fully animate. |
| 24 for (int i = 0; i < 10; ++i) { | 20 PlatformThread::Sleep(sleep_timeout_ms()); |
| 25 PlatformThread::Sleep(sleep_timeout_ms()); | |
| 26 if (page_title == GetActiveTabTitle()) | |
| 27 break; | |
| 28 } | |
| 29 | 21 |
| 30 // Make sure the navigation succeeded. | 22 std::wstring page_title = L"animated gif test"; |
| 31 EXPECT_EQ(page_title, GetActiveTabTitle()); | 23 EXPECT_EQ(page_title, GetActiveTabTitle()); |
| 32 | 24 |
| 33 // Tau will check if this crashed. | 25 // UI test framework will check if this crashed. |
| 34 } | 26 } |
| OLD | NEW |