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

Side by Side Diff: chrome/browser/extensions/extension_override_apitest.cc

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Fix Android Compilation Error Created 3 years, 9 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698