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

Side by Side Diff: chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc

Issue 128523003: Unregister Bluetooth profile when the extension that added it is unloaded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix style issue Created 6 years, 11 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 (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 <string.h> 5 #include <string.h>
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" 8 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h"
9 #include "chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h" 9 #include "chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 // Load and wait for setup 493 // Load and wait for setup
494 ExtensionTestMessageListener listener("ready", true); 494 ExtensionTestMessageListener listener("ready", true);
495 scoped_refptr<const Extension> extension( 495 scoped_refptr<const Extension> extension(
496 LoadExtension(test_data_dir_.AppendASCII("bluetooth/on_connection"))); 496 LoadExtension(test_data_dir_.AppendASCII("bluetooth/on_connection")));
497 ASSERT_TRUE(extension.get()); 497 ASSERT_TRUE(extension.get());
498 EXPECT_TRUE(listener.WaitUntilSatisfied()); 498 EXPECT_TRUE(listener.WaitUntilSatisfied());
499 499
500 scoped_refptr<device::MockBluetoothSocket> socket = 500 scoped_refptr<device::MockBluetoothSocket> socket =
501 new device::MockBluetoothSocket(); 501 new device::MockBluetoothSocket();
502 502
503 event_router()->AddProfile("1234", profile1_.get()); 503 event_router()->AddProfile("1234", extension->id(), profile1_.get());
504 event_router()->DispatchConnectionEvent( 504 event_router()->DispatchConnectionEvent(
505 extension->id(), "1234", device1_.get(), socket); 505 extension->id(), "1234", device1_.get(), socket);
506 506
507 listener.Reply("go"); 507 listener.Reply("go");
508 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 508 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
509 event_router()->RemoveProfile("1234"); 509 event_router()->RemoveProfile("1234");
510 } 510 }
511 511
512 IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetProfiles) { 512 IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetProfiles) {
513 ResultCatcher catcher; 513 ResultCatcher catcher;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 // Load and wait for setup 570 // Load and wait for setup
571 ExtensionTestMessageListener listener("ready", true); 571 ExtensionTestMessageListener listener("ready", true);
572 ASSERT_TRUE(LoadExtension( 572 ASSERT_TRUE(LoadExtension(
573 test_data_dir_.AppendASCII("bluetooth/get_devices_error"))); 573 test_data_dir_.AppendASCII("bluetooth/get_devices_error")));
574 EXPECT_TRUE(listener.WaitUntilSatisfied()); 574 EXPECT_TRUE(listener.WaitUntilSatisfied());
575 575
576 listener.Reply("go"); 576 listener.Reply("go");
577 577
578 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 578 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
579 } 579 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698