| 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 "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/extensions/extension_web_ui.h" | 8 #include "chrome/browser/extensions/extension_web_ui.h" |
| 9 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 9 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 ASSERT_TRUE(CheckHistoryOverridesContainsNoDupes()); | 120 ASSERT_TRUE(CheckHistoryOverridesContainsNoDupes()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 IN_PROC_BROWSER_TEST_F(ExtensionOverrideTest, ShouldCleanUpDuplicateEntries) { | 123 IN_PROC_BROWSER_TEST_F(ExtensionOverrideTest, ShouldCleanUpDuplicateEntries) { |
| 124 // Simulate several LoadExtension() calls happening over the lifetime of | 124 // Simulate several LoadExtension() calls happening over the lifetime of |
| 125 // a preferences file without corresponding UnloadExtension() calls. This is | 125 // a preferences file without corresponding UnloadExtension() calls. This is |
| 126 // the same as the above test, except for that it is testing the case where | 126 // the same as the above test, except for that it is testing the case where |
| 127 // the file already contains dupes when an extension is loaded. | 127 // the file already contains dupes when an extension is loaded. |
| 128 base::ListValue* list = new base::ListValue(); | 128 base::ListValue* list = new base::ListValue(); |
| 129 for (size_t i = 0; i < 3; ++i) | 129 for (size_t i = 0; i < 3; ++i) |
| 130 list->Append(Value::CreateStringValue("http://www.google.com/")); | 130 list->Append(new base::StringValue("http://www.google.com/")); |
| 131 | 131 |
| 132 { | 132 { |
| 133 DictionaryPrefUpdate update(browser()->profile()->GetPrefs(), | 133 DictionaryPrefUpdate update(browser()->profile()->GetPrefs(), |
| 134 ExtensionWebUI::kExtensionURLOverrides); | 134 ExtensionWebUI::kExtensionURLOverrides); |
| 135 update.Get()->Set("history", list); | 135 update.Get()->Set("history", list); |
| 136 } | 136 } |
| 137 | 137 |
| 138 ASSERT_FALSE(CheckHistoryOverridesContainsNoDupes()); | 138 ASSERT_FALSE(CheckHistoryOverridesContainsNoDupes()); |
| 139 | 139 |
| 140 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("override/history"))); | 140 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("override/history"))); |
| 141 | 141 |
| 142 ASSERT_TRUE(CheckHistoryOverridesContainsNoDupes()); | 142 ASSERT_TRUE(CheckHistoryOverridesContainsNoDupes()); |
| 143 } | 143 } |
| OLD | NEW |