| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 base::TimeDelta::FromSeconds(1)); | 334 base::TimeDelta::FromSeconds(1)); |
| 335 | 335 |
| 336 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "remove_device.html")); | 336 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "remove_device.html")); |
| 337 } | 337 } |
| 338 | 338 |
| 339 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, SendQuery) { | 339 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, SendQuery) { |
| 340 // TODO(noamsml): Win Dbg has a workaround that makes RunExtensionSubtest | 340 // TODO(noamsml): Win Dbg has a workaround that makes RunExtensionSubtest |
| 341 // always return true without actually running the test. Remove when fixed. | 341 // always return true without actually running the test. Remove when fixed. |
| 342 // See http://crbug.com/177163 for details. | 342 // See http://crbug.com/177163 for details. |
| 343 #if !defined(OS_WIN) || defined(NDEBUG) | 343 #if !defined(OS_WIN) || defined(NDEBUG) |
| 344 EXPECT_CALL(*test_service_discovery_client_, | 344 EXPECT_CALL(*test_service_discovery_client_.get(), |
| 345 OnSendTo(std::string(reinterpret_cast<const char*>(kQueryPacket), | 345 OnSendTo(std::string(reinterpret_cast<const char*>(kQueryPacket), |
| 346 sizeof(kQueryPacket)))).Times(2); | 346 sizeof(kQueryPacket)))).Times(2); |
| 347 #endif | 347 #endif |
| 348 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "send_query.html")); | 348 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "send_query.html")); |
| 349 } | 349 } |
| 350 | 350 |
| 351 #endif // ENABLE_MDNS | 351 #endif // ENABLE_MDNS |
| 352 | 352 |
| 353 #if defined(ENABLE_WIFI_BOOTSTRAPPING) | 353 #if defined(ENABLE_WIFI_BOOTSTRAPPING) |
| 354 | 354 |
| 355 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, WifiMessage) { | 355 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, WifiMessage) { |
| 356 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "wifi_message.html")); | 356 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "wifi_message.html")); |
| 357 } | 357 } |
| 358 | 358 |
| 359 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, WifiPasswords) { | 359 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, WifiPasswords) { |
| 360 // TODO(noamsml): Win Dbg has a workaround that makes RunExtensionSubtest | 360 // TODO(noamsml): Win Dbg has a workaround that makes RunExtensionSubtest |
| 361 // always return true without actually running the test. Remove when fixed. | 361 // always return true without actually running the test. Remove when fixed. |
| 362 // See http://crbug.com/177163 for details. | 362 // See http://crbug.com/177163 for details. |
| 363 #if !defined(OS_WIN) || defined(NDEBUG) | 363 #if !defined(OS_WIN) || defined(NDEBUG) |
| 364 EXPECT_CALL(wifi_manager_factory_, WifiManagerCreated()) | 364 EXPECT_CALL(wifi_manager_factory_, WifiManagerCreated()) |
| 365 .WillOnce(Invoke(this, &GcdPrivateAPITest::OnCreateWifiManager)); | 365 .WillOnce(Invoke(this, &GcdPrivateAPITest::OnCreateWifiManager)); |
| 366 #endif | 366 #endif |
| 367 | 367 |
| 368 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "wifi_password.html")); | 368 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "wifi_password.html")); |
| 369 } | 369 } |
| 370 | 370 |
| 371 #endif // ENABLE_WIFI_BOOTSTRAPPING | 371 #endif // ENABLE_WIFI_BOOTSTRAPPING |
| 372 | 372 |
| 373 } // namespace | 373 } // namespace |
| OLD | NEW |