| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 440 |
| 441 void SetUpCommandLine(base::CommandLine* command_line) override { | 441 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 442 #if defined(OS_CHROMEOS) | 442 #if defined(OS_CHROMEOS) |
| 443 // On chromeos, don't sign in with the stub-user automatically. Use the | 443 // On chromeos, don't sign in with the stub-user automatically. Use the |
| 444 // kLoginUser instead. | 444 // kLoginUser instead. |
| 445 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, | 445 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
| 446 kSampleUser); | 446 kSampleUser); |
| 447 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 447 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
| 448 chrome::kTestUserProfileDir); | 448 chrome::kTestUserProfileDir); |
| 449 #endif | 449 #endif |
| 450 command_line->AppendSwitch(switches::kDisableDeviceDiscoveryNotifications); |
| 450 WebUIBrowserTest::SetUpCommandLine(command_line); | 451 WebUIBrowserTest::SetUpCommandLine(command_line); |
| 451 } | 452 } |
| 452 | 453 |
| 453 void RunFor(base::TimeDelta time_period) { | 454 void RunFor(base::TimeDelta time_period) { |
| 454 base::CancelableCallback<void()> callback( | 455 base::CancelableCallback<void()> callback( |
| 455 base::Bind(&base::MessageLoop::QuitWhenIdle, | 456 base::Bind(&base::MessageLoop::QuitWhenIdle, |
| 456 base::Unretained(base::MessageLoop::current()))); | 457 base::Unretained(base::MessageLoop::current()))); |
| 457 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 458 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 458 FROM_HERE, callback.callback(), time_period); | 459 FROM_HERE, callback.callback(), time_period); |
| 459 | 460 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 510 |
| 510 test_service_discovery_client()->SimulateReceive( | 511 test_service_discovery_client()->SimulateReceive( |
| 511 kGoodbyePacket, sizeof(kGoodbyePacket)); | 512 kGoodbyePacket, sizeof(kGoodbyePacket)); |
| 512 | 513 |
| 513 RunFor(base::TimeDelta::FromMilliseconds(1100)); | 514 RunFor(base::TimeDelta::FromMilliseconds(1100)); |
| 514 | 515 |
| 515 EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("checkNoDevices")); | 516 EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("checkNoDevices")); |
| 516 } | 517 } |
| 517 | 518 |
| 518 // Flaky: http://crbug.com/660669. | 519 // Flaky: http://crbug.com/660669. |
| 519 IN_PROC_BROWSER_TEST_F(LocalDiscoveryUITest, DISABLED_RegisterTest) { | 520 IN_PROC_BROWSER_TEST_F(LocalDiscoveryUITest, RegisterTest) { |
| 520 TestMessageLoopCondition condition_token_claimed; | 521 TestMessageLoopCondition condition_token_claimed; |
| 521 | 522 |
| 522 ui_test_utils::NavigateToURL(browser(), GURL( | 523 ui_test_utils::NavigateToURL(browser(), GURL( |
| 523 chrome::kChromeUIDevicesURL)); | 524 chrome::kChromeUIDevicesURL)); |
| 524 condition_devices_listed().Wait(); | 525 condition_devices_listed().Wait(); |
| 525 | 526 |
| 526 test_service_discovery_client()->SimulateReceive( | 527 test_service_discovery_client()->SimulateReceive( |
| 527 kAnnouncePacket, sizeof(kAnnouncePacket)); | 528 kAnnouncePacket, sizeof(kAnnouncePacket)); |
| 528 | 529 |
| 529 base::RunLoop().RunUntilIdle(); | 530 base::RunLoop().RunUntilIdle(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 kAnnouncePacketRegistered, sizeof(kAnnouncePacketRegistered)); | 581 kAnnouncePacketRegistered, sizeof(kAnnouncePacketRegistered)); |
| 581 | 582 |
| 582 base::RunLoop().RunUntilIdle(); | 583 base::RunLoop().RunUntilIdle(); |
| 583 | 584 |
| 584 EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("expectRegisterDone")); | 585 EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("expectRegisterDone")); |
| 585 } | 586 } |
| 586 | 587 |
| 587 } // namespace | 588 } // namespace |
| 588 | 589 |
| 589 } // namespace local_discovery | 590 } // namespace local_discovery |
| OLD | NEW |