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

Side by Side Diff: extensions/browser/event_router_unittest.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/event_router.h" 5 #include "extensions/browser/event_router.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "extensions/browser/extension_pref_value_map.h" 24 #include "extensions/browser/extension_pref_value_map.h"
25 #include "extensions/browser/extension_prefs.h" 25 #include "extensions/browser/extension_prefs.h"
26 #include "extensions/browser/extension_prefs_factory.h" 26 #include "extensions/browser/extension_prefs_factory.h"
27 #include "extensions/browser/extensions_test.h" 27 #include "extensions/browser/extensions_test.h"
28 #include "extensions/common/extension_builder.h" 28 #include "extensions/common/extension_builder.h"
29 #include "extensions/common/test_util.h" 29 #include "extensions/common/test_util.h"
30 #include "testing/gtest/include/gtest/gtest.h" 30 #include "testing/gtest/include/gtest/gtest.h"
31 31
32 using base::DictionaryValue; 32 using base::DictionaryValue;
33 using base::ListValue; 33 using base::ListValue;
34 using base::StringValue; 34 using base::Value;
35 35
36 namespace extensions { 36 namespace extensions {
37 37
38 namespace { 38 namespace {
39 39
40 // A simple mock to keep track of listener additions and removals. 40 // A simple mock to keep track of listener additions and removals.
41 class MockEventRouterObserver : public EventRouter::Observer { 41 class MockEventRouterObserver : public EventRouter::Observer {
42 public: 42 public:
43 MockEventRouterObserver() 43 MockEventRouterObserver()
44 : listener_added_count_(0), 44 : listener_added_count_(0),
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 return builder.Build(); 118 return builder.Build();
119 } 119 }
120 120
121 std::unique_ptr<DictionaryValue> CreateHostSuffixFilter( 121 std::unique_ptr<DictionaryValue> CreateHostSuffixFilter(
122 const std::string& suffix) { 122 const std::string& suffix) {
123 std::unique_ptr<DictionaryValue> filter(new DictionaryValue()); 123 std::unique_ptr<DictionaryValue> filter(new DictionaryValue());
124 std::unique_ptr<ListValue> filter_list(new ListValue()); 124 std::unique_ptr<ListValue> filter_list(new ListValue());
125 std::unique_ptr<DictionaryValue> filter_dict(new DictionaryValue()); 125 std::unique_ptr<DictionaryValue> filter_dict(new DictionaryValue());
126 126
127 filter_dict->Set("hostSuffix", base::MakeUnique<StringValue>(suffix)); 127 filter_dict->Set("hostSuffix", base::MakeUnique<Value>(suffix));
128 filter_list->Append(std::move(filter_dict)); 128 filter_list->Append(std::move(filter_dict));
129 filter->Set("url", std::move(filter_list)); 129 filter->Set("url", std::move(filter_list));
130 130
131 return filter; 131 return filter;
132 } 132 }
133 133
134 } // namespace 134 } // namespace
135 135
136 class EventRouterTest : public ExtensionsTest { 136 class EventRouterTest : public ExtensionsTest {
137 public: 137 public:
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 440
441 // Remove the third filter. 441 // Remove the third filter.
442 event_router()->RemoveFilteredEventListener(kEventName, render_process_host(), 442 event_router()->RemoveFilteredEventListener(kEventName, render_process_host(),
443 kExtensionId, *filters[2], true); 443 kExtensionId, *filters[2], true);
444 ASSERT_FALSE(ContainsFilter(kExtensionId, kEventName, *filters[0])); 444 ASSERT_FALSE(ContainsFilter(kExtensionId, kEventName, *filters[0]));
445 ASSERT_FALSE(ContainsFilter(kExtensionId, kEventName, *filters[1])); 445 ASSERT_FALSE(ContainsFilter(kExtensionId, kEventName, *filters[1]));
446 ASSERT_FALSE(ContainsFilter(kExtensionId, kEventName, *filters[2])); 446 ASSERT_FALSE(ContainsFilter(kExtensionId, kEventName, *filters[2]));
447 } 447 }
448 448
449 } // namespace extensions 449 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/event_listener_map_unittest.cc ('k') | extensions/browser/extension_pref_value_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698