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

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

Issue 190663012: Run ContentMain in a browser_test's browser process. This removes duplication of code in the browse… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: try to fix android by restoring old path just for it Created 6 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 | 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 "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" 9 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h"
10 #include "chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h" 10 #include "chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h"
(...skipping 26 matching lines...) Expand all
37 namespace utils = extension_function_test_utils; 37 namespace utils = extension_function_test_utils;
38 namespace api = extensions::api; 38 namespace api = extensions::api;
39 39
40 namespace { 40 namespace {
41 41
42 static const char* kAdapterAddress = "A1:A2:A3:A4:A5:A6"; 42 static const char* kAdapterAddress = "A1:A2:A3:A4:A5:A6";
43 static const char* kName = "whatsinaname"; 43 static const char* kName = "whatsinaname";
44 44
45 class BluetoothApiTest : public ExtensionApiTest { 45 class BluetoothApiTest : public ExtensionApiTest {
46 public: 46 public:
47 BluetoothApiTest() : empty_extension_(utils::CreateEmptyExtension()) {} 47 BluetoothApiTest() {}
48 48
49 virtual void SetUpOnMainThread() OVERRIDE { 49 virtual void SetUpOnMainThread() OVERRIDE {
50 ExtensionApiTest::SetUpOnMainThread();
51 empty_extension_ = utils::CreateEmptyExtension();
50 SetUpMockAdapter(); 52 SetUpMockAdapter();
51 profile1_.reset(new testing::NiceMock<MockBluetoothProfile>()); 53 profile1_.reset(new testing::NiceMock<MockBluetoothProfile>());
52 profile2_.reset(new testing::NiceMock<MockBluetoothProfile>()); 54 profile2_.reset(new testing::NiceMock<MockBluetoothProfile>());
53 } 55 }
54 56
55 virtual void CleanUpOnMainThread() OVERRIDE { 57 virtual void CleanUpOnMainThread() OVERRIDE {
56 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)); 58 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_));
57 } 59 }
58 60
59 void SetUpMockAdapter() { 61 void SetUpMockAdapter() {
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 // Load and wait for setup 656 // Load and wait for setup
655 ExtensionTestMessageListener listener("ready", true); 657 ExtensionTestMessageListener listener("ready", true);
656 ASSERT_TRUE( 658 ASSERT_TRUE(
657 LoadExtension(test_data_dir_.AppendASCII("bluetooth/device_info"))); 659 LoadExtension(test_data_dir_.AppendASCII("bluetooth/device_info")));
658 EXPECT_TRUE(listener.WaitUntilSatisfied()); 660 EXPECT_TRUE(listener.WaitUntilSatisfied());
659 661
660 listener.Reply("go"); 662 listener.Reply("go");
661 663
662 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 664 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
663 } 665 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/login_utils_browsertest.cc ('k') | chrome/browser/extensions/api/socket/socket_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698