| OLD | NEW |
| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "chrome/browser/extensions/api/gcd_private/gcd_private_api.h" | 9 #include "chrome/browser/extensions/api/gcd_private/gcd_private_api.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 class GcdPrivateAPITest : public ExtensionApiTest { | 206 class GcdPrivateAPITest : public ExtensionApiTest { |
| 207 public: | 207 public: |
| 208 GcdPrivateAPITest() { | 208 GcdPrivateAPITest() { |
| 209 #if defined(ENABLE_MDNS) | 209 #if defined(ENABLE_MDNS) |
| 210 test_service_discovery_client_ = | 210 test_service_discovery_client_ = |
| 211 new local_discovery::TestServiceDiscoveryClient(); | 211 new local_discovery::TestServiceDiscoveryClient(); |
| 212 test_service_discovery_client_->Start(); | 212 test_service_discovery_client_->Start(); |
| 213 #endif // ENABLE_MDNS | 213 #endif // ENABLE_MDNS |
| 214 } | 214 } |
| 215 | 215 |
| 216 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 217 ExtensionApiTest::SetUpCommandLine(command_line); |
| 218 command_line->AppendSwitchASCII( |
| 219 extensions::switches::kWhitelistedExtensionID, |
| 220 "ddchlicdkolnonkihahngkmmmjnjlkkf"); |
| 221 } |
| 222 |
| 216 protected: | 223 protected: |
| 217 FakeGCDApiFlowFactory api_flow_factory_; | 224 FakeGCDApiFlowFactory api_flow_factory_; |
| 218 | 225 |
| 219 #if defined(ENABLE_MDNS) | 226 #if defined(ENABLE_MDNS) |
| 220 scoped_refptr<local_discovery::TestServiceDiscoveryClient> | 227 scoped_refptr<local_discovery::TestServiceDiscoveryClient> |
| 221 test_service_discovery_client_; | 228 test_service_discovery_client_; |
| 222 #endif // ENABLE_MDNS | 229 #endif // ENABLE_MDNS |
| 223 }; | 230 }; |
| 224 | 231 |
| 225 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, GetCloudList) { | 232 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, GetCloudList) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 EXPECT_CALL(*test_service_discovery_client_, | 285 EXPECT_CALL(*test_service_discovery_client_, |
| 279 OnSendTo(std::string(reinterpret_cast<const char*>(kQueryPacket), | 286 OnSendTo(std::string(reinterpret_cast<const char*>(kQueryPacket), |
| 280 sizeof(kQueryPacket)))).Times(2); | 287 sizeof(kQueryPacket)))).Times(2); |
| 281 #endif | 288 #endif |
| 282 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "send_query.html")); | 289 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "send_query.html")); |
| 283 } | 290 } |
| 284 | 291 |
| 285 #endif // ENABLE_MDNS | 292 #endif // ENABLE_MDNS |
| 286 | 293 |
| 287 } // namespace | 294 } // namespace |
| OLD | NEW |