OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/dom_ui/new_tab_ui.h" | 8 #include "chrome/browser/dom_ui/new_tab_ui.h" |
9 #include "chrome/browser/prefs/pref_value_store.h" | 9 #include "chrome/browser/prefs/pref_value_store.h" |
10 #include "chrome/browser/sync/signin_manager.h" | 10 #include "chrome/browser/sync/signin_manager.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 ASSERT_TRUE(tab.get()); | 45 ASSERT_TRUE(tab.get()); |
46 | 46 |
47 // TopSites should return at least 3 non-filler pages. | 47 // TopSites should return at least 3 non-filler pages. |
48 // 8 - 3 = max 5 filler pages. | 48 // 8 - 3 = max 5 filler pages. |
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 <= 5)", | 51 L"document.getElementsByClassName('filler').length <= 5)", |
52 action_max_timeout_ms())); | 52 action_max_timeout_ms())); |
53 } | 53 } |
54 | 54 |
55 TEST_F(NewTabUITest, NTPHasLoginName) { | 55 // Sometimes hangs: http://crbug.com/70157 |
| 56 TEST_F(NewTabUITest, DISABLED_NTPHasLoginName) { |
56 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); | 57 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); |
57 ASSERT_TRUE(window.get()); | 58 ASSERT_TRUE(window.get()); |
58 | 59 |
59 ASSERT_TRUE(window->SetStringPreference(prefs::kGoogleServicesUsername, | 60 ASSERT_TRUE(window->SetStringPreference(prefs::kGoogleServicesUsername, |
60 "user@gmail.com")); | 61 "user@gmail.com")); |
61 // Bring up a new tab page. | 62 // Bring up a new tab page. |
62 ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB)); | 63 ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB)); |
63 int load_time; | 64 int load_time; |
64 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time)); | 65 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time)); |
65 | 66 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 ASSERT_EQ(0, prefs->GetInteger(prefs::kNTPPrefVersion)); | 145 ASSERT_EQ(0, prefs->GetInteger(prefs::kNTPPrefVersion)); |
145 | 146 |
146 bool migrated = NewTabUI::UpdateUserPrefsVersion(prefs.get()); | 147 bool migrated = NewTabUI::UpdateUserPrefsVersion(prefs.get()); |
147 ASSERT_TRUE(migrated); | 148 ASSERT_TRUE(migrated); |
148 ASSERT_EQ(NewTabUI::current_pref_version(), | 149 ASSERT_EQ(NewTabUI::current_pref_version(), |
149 prefs->GetInteger(prefs::kNTPPrefVersion)); | 150 prefs->GetInteger(prefs::kNTPPrefVersion)); |
150 | 151 |
151 migrated = NewTabUI::UpdateUserPrefsVersion(prefs.get()); | 152 migrated = NewTabUI::UpdateUserPrefsVersion(prefs.get()); |
152 ASSERT_FALSE(migrated); | 153 ASSERT_FALSE(migrated); |
153 } | 154 } |
OLD | NEW |