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

Side by Side Diff: extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc

Issue 1739183003: Make extensions::DictionaryBuilder and extensions::ListValue unmovable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 "extensions/browser/api/bluetooth/bluetooth_event_router.h" 5 #include "extensions/browser/api/bluetooth/bluetooth_event_router.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 router_->OnListenerAdded(); 76 router_->OnListenerAdded();
77 router_->OnListenerRemoved(); 77 router_->OnListenerRemoved();
78 router_->OnListenerRemoved(); 78 router_->OnListenerRemoved();
79 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); 79 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1);
80 router_->OnListenerRemoved(); 80 router_->OnListenerRemoved();
81 } 81 }
82 82
83 TEST_F(BluetoothEventRouterTest, UnloadExtension) { 83 TEST_F(BluetoothEventRouterTest, UnloadExtension) {
84 scoped_refptr<const Extension> extension = 84 scoped_refptr<const Extension> extension =
85 ExtensionBuilder() 85 ExtensionBuilder()
86 .SetManifest(std::move(DictionaryBuilder() 86 .SetManifest(DictionaryBuilder()
87 .Set("name", "BT event router test") 87 .Set("name", "BT event router test")
88 .Set("version", "1.0") 88 .Set("version", "1.0")
89 .Set("manifest_version", 2))) 89 .Set("manifest_version", 2)
90 .Build())
90 .SetID(kTestExtensionId) 91 .SetID(kTestExtensionId)
91 .Build(); 92 .Build();
92 93
93 ExtensionRegistry::Get(browser_context())->TriggerOnUnloaded( 94 ExtensionRegistry::Get(browser_context())->TriggerOnUnloaded(
94 extension.get(), UnloadedExtensionInfo::REASON_DISABLE); 95 extension.get(), UnloadedExtensionInfo::REASON_DISABLE);
95 96
96 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); 97 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1);
97 } 98 }
98 99
99 // This test check that calling SetDiscoveryFilter before StartDiscoverySession 100 // This test check that calling SetDiscoveryFilter before StartDiscoverySession
(...skipping 19 matching lines...) Expand all
119 testing::_, testing::_)).Times(1); 120 testing::_, testing::_)).Times(1);
120 121
121 router_->StartDiscoverySession(mock_adapter_, kTestExtensionId, 122 router_->StartDiscoverySession(mock_adapter_, kTestExtensionId,
122 base::Bind(&base::DoNothing), 123 base::Bind(&base::DoNothing),
123 base::Bind(&base::DoNothing)); 124 base::Bind(&base::DoNothing));
124 125
125 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); 126 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1);
126 } 127 }
127 128
128 } // namespace extensions 129 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698