| OLD | NEW |
| 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/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" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 pref_service->SetBoolean(prefs::kBlockThirdPartyCookies, true); | 67 pref_service->SetBoolean(prefs::kBlockThirdPartyCookies, true); |
| 68 | 68 |
| 69 EXPECT_TRUE(RunExtensionTest("content_settings/clear")) << message_; | 69 EXPECT_TRUE(RunExtensionTest("content_settings/clear")) << message_; |
| 70 | 70 |
| 71 const PrefService::Preference* pref = pref_service->FindPreference( | 71 const PrefService::Preference* pref = pref_service->FindPreference( |
| 72 prefs::kBlockThirdPartyCookies); | 72 prefs::kBlockThirdPartyCookies); |
| 73 ASSERT_TRUE(pref); | 73 ASSERT_TRUE(pref); |
| 74 EXPECT_FALSE(pref->IsExtensionControlled()); | 74 EXPECT_FALSE(pref->IsExtensionControlled()); |
| 75 EXPECT_EQ(true, pref_service->GetBoolean(prefs::kBlockThirdPartyCookies)); | 75 EXPECT_EQ(true, pref_service->GetBoolean(prefs::kBlockThirdPartyCookies)); |
| 76 } | 76 } |
| 77 |
| 78 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentSettingsOnChange) { |
| 79 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 80 switches::kEnableExperimentalExtensionApis); |
| 81 |
| 82 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 83 prefs->SetBoolean(prefs::kBlockThirdPartyCookies, false); |
| 84 |
| 85 EXPECT_TRUE(RunExtensionTestIncognito("content_settings/onchange")) << |
| 86 message_; |
| 87 } |
| OLD | NEW |