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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 api_flow_factory_.SetResponse( | 277 api_flow_factory_.SetResponse( |
278 GURL("https://www.google.com/cloudprint/search"), kCloudPrintResponse); | 278 GURL("https://www.google.com/cloudprint/search"), kCloudPrintResponse); |
279 | 279 |
280 api_flow_factory_.SetResponse( | 280 api_flow_factory_.SetResponse( |
281 GURL("https://www.googleapis.com/clouddevices/v1/devices"), kGCDResponse); | 281 GURL("https://www.googleapis.com/clouddevices/v1/devices"), kGCDResponse); |
282 | 282 |
283 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "get_cloud_list.html")); | 283 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "get_cloud_list.html")); |
284 } | 284 } |
285 | 285 |
286 #if defined(ENABLE_MDNS) | 286 #if defined(ENABLE_MDNS) |
| 287 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, DeviceInfo) { |
| 288 test_service_discovery_client_->SimulateReceive(kAnnouncePacket, |
| 289 sizeof(kAnnouncePacket)); |
| 290 url_fetcher_factory_.SetFakeResponse(GURL("http://1.2.3.4:8888/privet/info"), |
| 291 kPrivetInfoResponse, |
| 292 net::HTTP_OK, |
| 293 net::URLRequestStatus::SUCCESS); |
| 294 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "device_info.html")); |
| 295 } |
| 296 |
287 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, Session) { | 297 IN_PROC_BROWSER_TEST_F(GcdPrivateAPITest, Session) { |
288 test_service_discovery_client_->SimulateReceive(kAnnouncePacket, | 298 test_service_discovery_client_->SimulateReceive(kAnnouncePacket, |
289 sizeof(kAnnouncePacket)); | 299 sizeof(kAnnouncePacket)); |
290 url_fetcher_factory_.SetFakeResponse(GURL("http://1.2.3.4:8888/privet/info"), | 300 url_fetcher_factory_.SetFakeResponse(GURL("http://1.2.3.4:8888/privet/info"), |
291 kPrivetInfoResponse, | 301 kPrivetInfoResponse, |
292 net::HTTP_OK, | 302 net::HTTP_OK, |
293 net::URLRequestStatus::SUCCESS); | 303 net::URLRequestStatus::SUCCESS); |
294 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "session.html")); | 304 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "session.html")); |
295 } | 305 } |
296 | 306 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 EXPECT_CALL(wifi_manager_factory_, WifiManagerCreated()) | 368 EXPECT_CALL(wifi_manager_factory_, WifiManagerCreated()) |
359 .WillOnce(Invoke(this, &GcdPrivateAPITest::OnCreateWifiManager)); | 369 .WillOnce(Invoke(this, &GcdPrivateAPITest::OnCreateWifiManager)); |
360 #endif | 370 #endif |
361 | 371 |
362 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "wifi_password.html")); | 372 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "wifi_password.html")); |
363 } | 373 } |
364 | 374 |
365 #endif // ENABLE_WIFI_BOOTSTRAPPING | 375 #endif // ENABLE_WIFI_BOOTSTRAPPING |
366 | 376 |
367 } // namespace | 377 } // namespace |
OLD | NEW |