| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 #include "chrome/browser/prefs/pref_service.h" | 6 #include "chrome/browser/prefs/pref_service.h" |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| 11 | 11 |
| 12 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FontSettings) { | 12 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FontSettings) { |
| 13 CommandLine::ForCurrentProcess()->AppendSwitch( | 13 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 14 switches::kEnableExperimentalExtensionApis); | 14 switches::kEnableExperimentalExtensionApis); |
| 15 | 15 |
| 16 PrefService* prefs = browser()->profile()->GetPrefs(); | 16 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 17 prefs->SetString(prefs::kWebKitStandardFontFamilyKorean, "Tahoma"); | 17 prefs->SetString(prefs::kWebKitStandardFontFamilyKorean, "Tahoma"); |
| 18 prefs->SetString(prefs::kWebKitSansSerifFontFamily, "Arial"); | 18 prefs->SetString(prefs::kWebKitSansSerifFontFamily, "Arial"); |
| 19 prefs->SetInteger(prefs::kWebKitGlobalDefaultFontSize, 16); | 19 prefs->SetInteger(prefs::kWebKitDefaultFontSize, 16); |
| 20 prefs->SetInteger(prefs::kWebKitGlobalDefaultFixedFontSize, 14); | 20 prefs->SetInteger(prefs::kWebKitDefaultFixedFontSize, 14); |
| 21 prefs->SetInteger(prefs::kWebKitGlobalMinimumFontSize, 8); | 21 prefs->SetInteger(prefs::kWebKitMinimumFontSize, 8); |
| 22 prefs->SetString(prefs::kGlobalDefaultCharset, "Shift_JIS"); | 22 prefs->SetString(prefs::kDefaultCharset, "Shift_JIS"); |
| 23 | 23 |
| 24 EXPECT_TRUE(RunExtensionTest("font_settings/standard")) << message_; | 24 EXPECT_TRUE(RunExtensionTest("font_settings/standard")) << message_; |
| 25 } | 25 } |
| 26 | 26 |
| 27 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FontSettingsIncognito) { | 27 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FontSettingsIncognito) { |
| 28 CommandLine::ForCurrentProcess()->AppendSwitch( | 28 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 29 switches::kEnableExperimentalExtensionApis); | 29 switches::kEnableExperimentalExtensionApis); |
| 30 | 30 |
| 31 PrefService* prefs = browser()->profile()->GetPrefs(); | 31 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 32 prefs->SetString(prefs::kWebKitStandardFontFamilyKorean, "Tahoma"); | 32 prefs->SetString(prefs::kWebKitStandardFontFamilyKorean, "Tahoma"); |
| 33 prefs->SetString(prefs::kWebKitSansSerifFontFamily, "Arial"); | 33 prefs->SetString(prefs::kWebKitSansSerifFontFamily, "Arial"); |
| 34 prefs->SetInteger(prefs::kWebKitGlobalDefaultFontSize, 16); | 34 prefs->SetInteger(prefs::kWebKitDefaultFontSize, 16); |
| 35 | 35 |
| 36 int flags = ExtensionApiTest::kFlagEnableIncognito | | 36 int flags = ExtensionApiTest::kFlagEnableIncognito | |
| 37 ExtensionApiTest::kFlagUseIncognito; | 37 ExtensionApiTest::kFlagUseIncognito; |
| 38 EXPECT_TRUE(RunExtensionSubtest("font_settings/incognito", | 38 EXPECT_TRUE(RunExtensionSubtest("font_settings/incognito", |
| 39 "launch.html", | 39 "launch.html", |
| 40 flags)); | 40 flags)); |
| 41 } | 41 } |
| OLD | NEW |