Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Side by Side Diff: chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc

Issue 2706183002: Fix flaky tests by disabling DeviceDiscoveryNotification service. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/api/gcd_private/gcd_private_apitest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/gcd_private/gcd_private_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698