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

Side by Side Diff: chrome/browser/dom_ui/new_tab_ui_uitest.cc

Issue 342068: Third patch in getting rid of caching MessageLoop pointers and always using C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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) 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/dom_ui/new_tab_ui.h" 9 #include "chrome/browser/dom_ui/new_tab_ui.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 &filler_thumbnails_count)); 53 &filler_thumbnails_count));
54 if (filler_thumbnails_count == 0) 54 if (filler_thumbnails_count == 0)
55 break; 55 break;
56 PlatformThread::Sleep(kWaitDuration); 56 PlatformThread::Sleep(kWaitDuration);
57 wait_time -= kWaitDuration; 57 wait_time -= kWaitDuration;
58 } 58 }
59 EXPECT_EQ(0, filler_thumbnails_count); 59 EXPECT_EQ(0, filler_thumbnails_count);
60 } 60 }
61 61
62 TEST_F(NewTabUITest, UpdateUserPrefsVersion) { 62 TEST_F(NewTabUITest, UpdateUserPrefsVersion) {
63 PrefService prefs(FilePath(), NULL); 63 PrefService prefs((FilePath()));
64 64
65 // Does the migration 65 // Does the migration
66 NewTabUI::RegisterUserPrefs(&prefs); 66 NewTabUI::RegisterUserPrefs(&prefs);
67 67
68 ASSERT_EQ(NewTabUI::current_pref_version(), 68 ASSERT_EQ(NewTabUI::current_pref_version(),
69 prefs.GetInteger(prefs::kNTPPrefVersion)); 69 prefs.GetInteger(prefs::kNTPPrefVersion));
70 70
71 // Reset the version 71 // Reset the version
72 prefs.ClearPref(prefs::kNTPPrefVersion); 72 prefs.ClearPref(prefs::kNTPPrefVersion);
73 ASSERT_EQ(0, prefs.GetInteger(prefs::kNTPPrefVersion)); 73 ASSERT_EQ(0, prefs.GetInteger(prefs::kNTPPrefVersion));
74 74
75 bool migrated = NewTabUI::UpdateUserPrefsVersion(&prefs); 75 bool migrated = NewTabUI::UpdateUserPrefsVersion(&prefs);
76 ASSERT_TRUE(migrated); 76 ASSERT_TRUE(migrated);
77 ASSERT_EQ(NewTabUI::current_pref_version(), 77 ASSERT_EQ(NewTabUI::current_pref_version(),
78 prefs.GetInteger(prefs::kNTPPrefVersion)); 78 prefs.GetInteger(prefs::kNTPPrefVersion));
79 79
80 migrated = NewTabUI::UpdateUserPrefsVersion(&prefs); 80 migrated = NewTabUI::UpdateUserPrefsVersion(&prefs);
81 ASSERT_FALSE(migrated); 81 ASSERT_FALSE(migrated);
82 } 82 }
OLDNEW
« no previous file with comments | « chrome/browser/debugger/devtools_protocol_handler.cc ('k') | chrome/browser/dom_ui/shown_sections_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698