OLD | NEW |
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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/extensions/api/dial/dial_api.h" | 6 #include "chrome/browser/extensions/api/dial/dial_api.h" |
7 #include "chrome/browser/extensions/api/dial/dial_api_factory.h" | 7 #include "chrome/browser/extensions/api/dial/dial_api_factory.h" |
8 #include "chrome/browser/extensions/api/dial/dial_registry.h" | 8 #include "chrome/browser/extensions/api/dial/dial_registry.h" |
9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
11 #include "chrome/browser/extensions/extension_test_message_listener.h" | 11 #include "chrome/browser/extensions/extension_test_message_listener.h" |
12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 | 15 |
16 using extensions::DialDeviceData; | 16 using extensions::DialDeviceData; |
17 using extensions::Extension; | 17 using extensions::Extension; |
18 | 18 |
19 namespace api = extensions::api; | 19 namespace api = extensions::api; |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 class DialAPITest : public ExtensionApiTest { | 23 class DialAPITest : public ExtensionApiTest { |
24 public: | 24 public: |
25 DialAPITest() {} | 25 DialAPITest() {} |
26 | 26 |
27 virtual void SetUpCommandLine(CommandLine* command_line) { | 27 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
28 ExtensionApiTest::SetUpCommandLine(command_line); | 28 ExtensionApiTest::SetUpCommandLine(command_line); |
29 command_line->AppendSwitchASCII( | 29 command_line->AppendSwitchASCII( |
30 switches::kWhitelistedExtensionID, "ddchlicdkolnonkihahngkmmmjnjlkkf"); | 30 switches::kWhitelistedExtensionID, "ddchlicdkolnonkihahngkmmmjnjlkkf"); |
31 } | 31 } |
32 }; | 32 }; |
33 | 33 |
34 } // namespace | 34 } // namespace |
35 | 35 |
36 // Test receiving DIAL API events. | 36 // Test receiving DIAL API events. |
37 IN_PROC_BROWSER_TEST_F(DialAPITest, DeviceEvents) { | 37 IN_PROC_BROWSER_TEST_F(DialAPITest, DeviceEvents) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 test_data_dir_.AppendASCII("dial/whitelist"), | 99 test_data_dir_.AppendASCII("dial/whitelist"), |
100 ExtensionBrowserTest::kFlagIgnoreManifestWarnings); | 100 ExtensionBrowserTest::kFlagIgnoreManifestWarnings); |
101 // We should have a DIAL API not available warning. | 101 // We should have a DIAL API not available warning. |
102 ASSERT_FALSE(extension->install_warnings().empty()); | 102 ASSERT_FALSE(extension->install_warnings().empty()); |
103 | 103 |
104 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 104 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
105 | 105 |
106 listener.Reply("go"); | 106 listener.Reply("go"); |
107 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 107 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
108 } | 108 } |
OLD | NEW |