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" |
12 #include "chrome/browser/local_discovery/test_service_discovery_client.h" | 13 #include "chrome/browser/local_discovery/test_service_discovery_client.h" |
13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 15 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
15 #include "chrome/browser/signin/signin_manager_factory.h" | 16 #include "chrome/browser/signin/signin_manager_factory.h" |
16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" | 18 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" |
18 #include "chrome/common/chrome_constants.h" | 19 #include "chrome/common/chrome_constants.h" |
19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 432 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
432 chrome::kTestUserProfileDir); | 433 chrome::kTestUserProfileDir); |
433 #endif | 434 #endif |
434 WebUIBrowserTest::SetUpCommandLine(command_line); | 435 WebUIBrowserTest::SetUpCommandLine(command_line); |
435 } | 436 } |
436 | 437 |
437 void RunFor(base::TimeDelta time_period) { | 438 void RunFor(base::TimeDelta time_period) { |
438 base::CancelableCallback<void()> callback(base::Bind( | 439 base::CancelableCallback<void()> callback(base::Bind( |
439 &base::MessageLoop::Quit, base::Unretained( | 440 &base::MessageLoop::Quit, base::Unretained( |
440 base::MessageLoop::current()))); | 441 base::MessageLoop::current()))); |
441 base::MessageLoop::current()->PostDelayedTask( | 442 base::MessageLoop::current()->task_runner()->PostDelayedTask( |
442 FROM_HERE, callback.callback(), time_period); | 443 FROM_HERE, callback.callback(), time_period); |
443 | 444 |
444 base::MessageLoop::current()->Run(); | 445 base::MessageLoop::current()->Run(); |
445 callback.Cancel(); | 446 callback.Cancel(); |
446 } | 447 } |
447 | 448 |
448 TestServiceDiscoveryClient* test_service_discovery_client() { | 449 TestServiceDiscoveryClient* test_service_discovery_client() { |
449 return test_service_discovery_client_.get(); | 450 return test_service_discovery_client_.get(); |
450 } | 451 } |
451 | 452 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 kAnnouncePacketRegistered, sizeof(kAnnouncePacketRegistered)); | 565 kAnnouncePacketRegistered, sizeof(kAnnouncePacketRegistered)); |
565 | 566 |
566 base::MessageLoop::current()->RunUntilIdle(); | 567 base::MessageLoop::current()->RunUntilIdle(); |
567 | 568 |
568 EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("expectRegisterDone")); | 569 EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("expectRegisterDone")); |
569 } | 570 } |
570 | 571 |
571 } // namespace | 572 } // namespace |
572 | 573 |
573 } // namespace local_discovery | 574 } // namespace local_discovery |
OLD | NEW |