| 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/test/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "chrome/app/chrome_dll_resource.h" | 8 #include "chrome/app/chrome_dll_resource.h" |
| 9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
| 10 #include "chrome/browser/dom_ui/new_tab_ui.h" | 10 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // If all the thumbnails load, there should be no div's with 'filler'. | 45 // If all the thumbnails load, there should be no div's with 'filler'. |
| 46 scoped_refptr<TabProxy> tab = window->GetActiveTab(); | 46 scoped_refptr<TabProxy> tab = window->GetActiveTab(); |
| 47 ASSERT_TRUE(tab.get()); | 47 ASSERT_TRUE(tab.get()); |
| 48 | 48 |
| 49 ASSERT_TRUE(WaitUntilJavaScriptCondition(tab, L"", | 49 ASSERT_TRUE(WaitUntilJavaScriptCondition(tab, L"", |
| 50 L"window.domAutomationController.send(" | 50 L"window.domAutomationController.send(" |
| 51 L"document.getElementsByClassName('filler').length == 0)", | 51 L"document.getElementsByClassName('filler').length == 0)", |
| 52 action_max_timeout_ms())); | 52 action_max_timeout_ms())); |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Fails about 5% of the time on XP. http://crbug.com/45001 | 55 // Fails about ~5% of the time on all platforms. http://crbug.com/45001 |
| 56 #if defined(OS_WIN) | 56 TEST_F(NewTabUITest, FLAKY_ChromeInternalLoadsNTP) { |
| 57 #define ChromeInternalLoadsNTP FLAKY_ChromeInternalLoadsNTP | |
| 58 #endif | |
| 59 TEST_F(NewTabUITest, ChromeInternalLoadsNTP) { | |
| 60 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); | 57 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); |
| 61 ASSERT_TRUE(window.get()); | 58 ASSERT_TRUE(window.get()); |
| 62 | 59 |
| 63 // Go to the "new tab page" using its old url, rather than chrome://newtab. | 60 // Go to the "new tab page" using its old url, rather than chrome://newtab. |
| 64 scoped_refptr<TabProxy> tab = window->GetTab(0); | 61 scoped_refptr<TabProxy> tab = window->GetTab(0); |
| 65 ASSERT_TRUE(tab.get()); | 62 ASSERT_TRUE(tab.get()); |
| 66 ASSERT_TRUE(tab->NavigateToURLAsync(GURL("chrome-internal:"))); | 63 ASSERT_TRUE(tab->NavigateToURLAsync(GURL("chrome-internal:"))); |
| 67 int load_time; | 64 int load_time; |
| 68 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time)); | 65 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time)); |
| 69 | 66 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 L"})()" | 161 L"})()" |
| 165 L")", | 162 L")", |
| 166 &has_class)); | 163 &has_class)); |
| 167 ASSERT_TRUE(has_class); | 164 ASSERT_TRUE(has_class); |
| 168 | 165 |
| 169 bool is_home_page; | 166 bool is_home_page; |
| 170 ASSERT_TRUE(browser->GetBooleanPreference(prefs::kHomePageIsNewTabPage, | 167 ASSERT_TRUE(browser->GetBooleanPreference(prefs::kHomePageIsNewTabPage, |
| 171 &is_home_page)); | 168 &is_home_page)); |
| 172 ASSERT_TRUE(is_home_page); | 169 ASSERT_TRUE(is_home_page); |
| 173 } | 170 } |
| OLD | NEW |