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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/location.h" | |
10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/single_thread_task_runner.h" | |
msw
2015/06/12 00:31:22
nit: remove sttr and ttrh headers.
| |
14 #include "base/thread_task_runner_handle.h" | |
12 #include "chrome/browser/local_discovery/test_service_discovery_client.h" | 15 #include "chrome/browser/local_discovery/test_service_discovery_client.h" |
13 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 17 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
15 #include "chrome/browser/signin/signin_manager_factory.h" | 18 #include "chrome/browser/signin/signin_manager_factory.h" |
16 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" | 20 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" |
18 #include "chrome/common/chrome_constants.h" | 21 #include "chrome/common/chrome_constants.h" |
19 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
21 #include "chrome/test/base/ui_test_utils.h" | 24 #include "chrome/test/base/ui_test_utils.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
434 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 437 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
435 chrome::kTestUserProfileDir); | 438 chrome::kTestUserProfileDir); |
436 #endif | 439 #endif |
437 WebUIBrowserTest::SetUpCommandLine(command_line); | 440 WebUIBrowserTest::SetUpCommandLine(command_line); |
438 } | 441 } |
439 | 442 |
440 void RunFor(base::TimeDelta time_period) { | 443 void RunFor(base::TimeDelta time_period) { |
441 base::CancelableCallback<void()> callback(base::Bind( | 444 base::CancelableCallback<void()> callback(base::Bind( |
442 &base::MessageLoop::Quit, base::Unretained( | 445 &base::MessageLoop::Quit, base::Unretained( |
443 base::MessageLoop::current()))); | 446 base::MessageLoop::current()))); |
444 base::MessageLoop::current()->PostDelayedTask( | 447 base::MessageLoop::current()->task_runner()->PostDelayedTask( |
445 FROM_HERE, callback.callback(), time_period); | 448 FROM_HERE, callback.callback(), time_period); |
446 | 449 |
447 base::MessageLoop::current()->Run(); | 450 base::MessageLoop::current()->Run(); |
448 callback.Cancel(); | 451 callback.Cancel(); |
449 } | 452 } |
450 | 453 |
451 TestServiceDiscoveryClient* test_service_discovery_client() { | 454 TestServiceDiscoveryClient* test_service_discovery_client() { |
452 return test_service_discovery_client_.get(); | 455 return test_service_discovery_client_.get(); |
453 } | 456 } |
454 | 457 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
567 kAnnouncePacketRegistered, sizeof(kAnnouncePacketRegistered)); | 570 kAnnouncePacketRegistered, sizeof(kAnnouncePacketRegistered)); |
568 | 571 |
569 base::MessageLoop::current()->RunUntilIdle(); | 572 base::MessageLoop::current()->RunUntilIdle(); |
570 | 573 |
571 EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("expectRegisterDone")); | 574 EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("expectRegisterDone")); |
572 } | 575 } |
573 | 576 |
574 } // namespace | 577 } // namespace |
575 | 578 |
576 } // namespace local_discovery | 579 } // namespace local_discovery |
OLD | NEW |