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

Side by Side Diff: chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_apitest.cc

Issue 325893002: Bluetooth: add socket & low_energy manifest check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add permission denied tests Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <string> 5 #include <string>
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h" 9 #include "chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 EXPECT_CALL(*mock_server_socket, Close()); 183 EXPECT_CALL(*mock_server_socket, Close());
184 184
185 EXPECT_CALL(*mock_client_socket, Disconnect(testing::_)) 185 EXPECT_CALL(*mock_client_socket, Disconnect(testing::_))
186 .WillOnce(InvokeCallbackArgument<0>()); 186 .WillOnce(InvokeCallbackArgument<0>());
187 EXPECT_CALL(*mock_client_socket, Close()); 187 EXPECT_CALL(*mock_client_socket, Close());
188 188
189 EXPECT_TRUE(listener.WaitUntilSatisfied()); 189 EXPECT_TRUE(listener.WaitUntilSatisfied());
190 listener.Reply("go"); 190 listener.Reply("go");
191 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 191 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
192 } 192 }
193
194 IN_PROC_BROWSER_TEST_F(BluetoothSocketApiTest, PermissionDenied) {
195 ResultCatcher catcher;
196 catcher.RestrictToProfile(browser()->profile());
197
198 // Run the test.
199 scoped_refptr<const Extension> extension(
200 LoadExtension(test_data_dir_.AppendASCII(
201 "bluetooth_socket/permission_denied")));
202 ASSERT_TRUE(extension.get());
203
204 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
205 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698