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

Side by Side Diff: chrome/browser/tab_contents/web_contents_unittest.cc

Issue 7647026: base: Add three helper functions to Values API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a typo Ceate -> Create Created 9 years, 4 months 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/dom_operation_notification_details.h" 7 #include "chrome/browser/dom_operation_notification_details.h"
8 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.h"
9 #include "chrome/browser/tab_contents/chrome_interstitial_page.h" 9 #include "chrome/browser/tab_contents/chrome_interstitial_page.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 private: 179 private:
180 // Supply our own profile so we use the correct profile data. The test harness 180 // Supply our own profile so we use the correct profile data. The test harness
181 // is not supposed to overwrite a profile if it's already created. 181 // is not supposed to overwrite a profile if it's already created.
182 virtual void SetUp() { 182 virtual void SetUp() {
183 TestingProfile* profile = new TestingProfile(); 183 TestingProfile* profile = new TestingProfile();
184 profile_.reset(profile); 184 profile_.reset(profile);
185 185
186 // Set some (WebKit) user preferences. 186 // Set some (WebKit) user preferences.
187 TestingPrefService* pref_services = profile->GetTestingPrefService(); 187 TestingPrefService* pref_services = profile->GetTestingPrefService();
188 #if defined(TOOLKIT_USES_GTK) 188 #if defined(TOOLKIT_USES_GTK)
189 pref_services->SetUserPref(prefs::kUsesSystemTheme, 189 pref_services->SetUserPref(prefs::kUsesSystemTheme, base::FalseValue());
190 Value::CreateBooleanValue(false));
191 #endif 190 #endif
192 pref_services->SetUserPref(prefs::kDefaultCharset, 191 pref_services->SetUserPref(prefs::kDefaultCharset,
193 Value::CreateStringValue("utf8")); 192 Value::CreateStringValue("utf8"));
194 pref_services->SetUserPref(prefs::kWebKitDefaultFontSize, 193 pref_services->SetUserPref(prefs::kWebKitDefaultFontSize,
195 Value::CreateIntegerValue(20)); 194 Value::CreateIntegerValue(20));
196 pref_services->SetUserPref(prefs::kWebKitTextAreasAreResizable, 195 pref_services->SetUserPref(prefs::kWebKitTextAreasAreResizable,
197 Value::CreateBooleanValue(false)); 196 base::FalseValue());
198 pref_services->SetUserPref(prefs::kWebKitUsesUniversalDetector, 197 pref_services->SetUserPref(prefs::kWebKitUsesUniversalDetector,
199 Value::CreateBooleanValue(true)); 198 base::TrueValue());
200 pref_services->SetUserPref("webkit.webprefs.foo", 199 pref_services->SetUserPref("webkit.webprefs.foo",
201 Value::CreateStringValue("bar")); 200 Value::CreateStringValue("bar"));
202 201
203 RenderViewHostTestHarness::SetUp(); 202 RenderViewHostTestHarness::SetUp();
204 } 203 }
205 204
206 virtual void TearDown() { 205 virtual void TearDown() {
207 RenderViewHostTestHarness::TearDown(); 206 RenderViewHostTestHarness::TearDown();
208 207
209 profile_.reset(NULL); 208 profile_.reset(NULL);
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 window.close_count = 0; 1799 window.close_count = 0;
1801 1800
1802 const int kWindowCount = 4; 1801 const int kWindowCount = 4;
1803 for (int i = 0; i < kWindowCount; i++) { 1802 for (int i = 0; i < kWindowCount; i++) {
1804 tab_contents->AddConstrainedDialog(&window); 1803 tab_contents->AddConstrainedDialog(&window);
1805 } 1804 }
1806 EXPECT_EQ(window.close_count, 0); 1805 EXPECT_EQ(window.close_count, 0);
1807 delete tab_contents; 1806 delete tab_contents;
1808 EXPECT_EQ(window.close_count, kWindowCount); 1807 EXPECT_EQ(window.close_count, kWindowCount);
1809 } 1808 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_ui_util.cc ('k') | chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698