Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: chrome/browser/ui/webui/ntp/new_tab_ui_uitest.cc

Issue 8438028: ntp: remove ShownSectionHandler and all references to it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more functional test updates Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/test/test_timeouts.h" 7 #include "base/test/test_timeouts.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time)); 175 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time));
176 176
177 // Ensure there are some thumbnails loaded in the page. 177 // Ensure there are some thumbnails loaded in the page.
178 int thumbnails_count = -1; 178 int thumbnails_count = -1;
179 ASSERT_TRUE(tab->ExecuteAndExtractInt(L"", 179 ASSERT_TRUE(tab->ExecuteAndExtractInt(L"",
180 L"window.domAutomationController.send(" 180 L"window.domAutomationController.send("
181 L"document.getElementsByClassName('thumbnail-container').length)", 181 L"document.getElementsByClassName('thumbnail-container').length)",
182 &thumbnails_count)); 182 &thumbnails_count));
183 EXPECT_GT(thumbnails_count, 0); 183 EXPECT_GT(thumbnails_count, 0);
184 } 184 }
185
186 // Bug 87200: Disable UpdateUserPrefsVersion for Windows
187 #if defined(OS_WIN)
188 #define MAYBE_UpdateUserPrefsVersion DISABLED_UpdateUserPrefsVersion
189 #else
190 #define MAYBE_UpdateUserPrefsVersion UpdateUserPrefsVersion
191 #endif
192 TEST_F(NewTabUITest, MAYBE_UpdateUserPrefsVersion) {
193 // PrefService with JSON user-pref file only, no enforced or advised prefs.
194 scoped_ptr<PrefService> prefs(new TestingPrefService);
195
196 // Does the migration
197 NewTabUI::RegisterUserPrefs(prefs.get());
198
199 ASSERT_EQ(NewTabUI::current_pref_version(),
200 prefs->GetInteger(prefs::kNTPPrefVersion));
201
202 // Reset the version
203 prefs->ClearPref(prefs::kNTPPrefVersion);
204 ASSERT_EQ(0, prefs->GetInteger(prefs::kNTPPrefVersion));
205
206 bool migrated = NewTabUI::UpdateUserPrefsVersion(prefs.get());
207 ASSERT_TRUE(migrated);
208 ASSERT_EQ(NewTabUI::current_pref_version(),
209 prefs->GetInteger(prefs::kNTPPrefVersion));
210
211 migrated = NewTabUI::UpdateUserPrefsVersion(prefs.get());
212 ASSERT_FALSE(migrated);
213 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui.cc ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698