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

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: Comment Updates 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 24 matching lines...) Expand all
35 ExtensionWebUI::kExtensionURLOverrides); 35 ExtensionWebUI::kExtensionURLOverrides);
36 36
37 const base::ListValue* values = nullptr; 37 const base::ListValue* values = nullptr;
38 if (!overrides->GetList("history", &values)) 38 if (!overrides->GetList("history", &values))
39 return false; 39 return false;
40 40
41 std::set<std::string> seen_overrides; 41 std::set<std::string> seen_overrides;
42 for (const auto& val : *values) { 42 for (const auto& val : *values) {
43 const base::DictionaryValue* dict = nullptr; 43 const base::DictionaryValue* dict = nullptr;
44 std::string entry; 44 std::string entry;
45 if (!val->GetAsDictionary(&dict) || !dict->GetString("entry", &entry) || 45 if (!val.GetAsDictionary(&dict) || !dict->GetString("entry", &entry) ||
46 seen_overrides.count(entry) != 0) 46 seen_overrides.count(entry) != 0)
47 return false; 47 return false;
48 seen_overrides.insert(entry); 48 seen_overrides.insert(entry);
49 } 49 }
50 50
51 return true; 51 return true;
52 } 52 }
53 53
54 // Returns AssertionSuccess() if the given |web_contents| is being actively 54 // Returns AssertionSuccess() if the given |web_contents| is being actively
55 // controlled by the extension with |extension_id|. 55 // controlled by the extension with |extension_id|.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 248 }
249 249
250 ASSERT_FALSE(CheckHistoryOverridesContainsNoDupes()); 250 ASSERT_FALSE(CheckHistoryOverridesContainsNoDupes());
251 251
252 ExtensionWebUI::InitializeChromeURLOverrides(profile()); 252 ExtensionWebUI::InitializeChromeURLOverrides(profile());
253 253
254 ASSERT_TRUE(CheckHistoryOverridesContainsNoDupes()); 254 ASSERT_TRUE(CheckHistoryOverridesContainsNoDupes());
255 } 255 }
256 256
257 } // namespace extensions 257 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698