| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_web_ui.h" | 10 #include "chrome/browser/extensions/extension_web_ui.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 ExtensionWebUI::kExtensionURLOverrides); | 39 ExtensionWebUI::kExtensionURLOverrides); |
| 40 | 40 |
| 41 const base::ListValue* values = nullptr; | 41 const base::ListValue* values = nullptr; |
| 42 if (!overrides->GetList("history", &values)) | 42 if (!overrides->GetList("history", &values)) |
| 43 return false; | 43 return false; |
| 44 | 44 |
| 45 std::set<std::string> seen_overrides; | 45 std::set<std::string> seen_overrides; |
| 46 for (const auto& val : *values) { | 46 for (const auto& val : *values) { |
| 47 const base::DictionaryValue* dict = nullptr; | 47 const base::DictionaryValue* dict = nullptr; |
| 48 std::string entry; | 48 std::string entry; |
| 49 if (!val->GetAsDictionary(&dict) || !dict->GetString("entry", &entry) || | 49 if (!val.GetAsDictionary(&dict) || !dict->GetString("entry", &entry) || |
| 50 seen_overrides.count(entry) != 0) | 50 seen_overrides.count(entry) != 0) |
| 51 return false; | 51 return false; |
| 52 seen_overrides.insert(entry); | 52 seen_overrides.insert(entry); |
| 53 } | 53 } |
| 54 | 54 |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 | 57 |
| 58 // Returns AssertionSuccess() if the given |web_contents| is being actively | 58 // Returns AssertionSuccess() if the given |web_contents| is being actively |
| 59 // controlled by the extension with |extension_id|. | 59 // controlled by the extension with |extension_id|. |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 289 } |
| 290 | 290 |
| 291 ASSERT_FALSE(CheckHistoryOverridesContainsNoDupes()); | 291 ASSERT_FALSE(CheckHistoryOverridesContainsNoDupes()); |
| 292 | 292 |
| 293 ExtensionWebUI::InitializeChromeURLOverrides(profile()); | 293 ExtensionWebUI::InitializeChromeURLOverrides(profile()); |
| 294 | 294 |
| 295 ASSERT_TRUE(CheckHistoryOverridesContainsNoDupes()); | 295 ASSERT_TRUE(CheckHistoryOverridesContainsNoDupes()); |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace extensions | 298 } // namespace extensions |
| OLD | NEW |