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

Side by Side Diff: chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc

Issue 1255263002: Remove a race around NetworkChangeNotifier::test_notifications_only_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Possible iOS fix Created 5 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/chromeos/file_manager/file_manager_browsertest_base.h" 5 #include "chrome/browser/chromeos/file_manager/file_manager_browsertest_base.h"
6 6
7 #include <deque> 7 #include <deque>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_value_converter.h" 10 #include "base/json/json_value_converter.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 if (GetGuestModeParam() != IN_GUEST_MODE) { 499 if (GetGuestModeParam() != IN_GUEST_MODE) {
500 create_drive_integration_service_ = 500 create_drive_integration_service_ =
501 base::Bind(&FileManagerBrowserTestBase::CreateDriveIntegrationService, 501 base::Bind(&FileManagerBrowserTestBase::CreateDriveIntegrationService,
502 base::Unretained(this)); 502 base::Unretained(this));
503 service_factory_for_test_.reset( 503 service_factory_for_test_.reset(
504 new drive::DriveIntegrationServiceFactory::ScopedFactoryForTest( 504 new drive::DriveIntegrationServiceFactory::ScopedFactoryForTest(
505 &create_drive_integration_service_)); 505 &create_drive_integration_service_));
506 } 506 }
507 } 507 }
508 508
509 void FileManagerBrowserTestBase::SetUp() {
510 net::NetworkChangeNotifier::SetTestNotificationsOnly(true);
511 ExtensionApiTest::SetUp();
512 }
513
509 void FileManagerBrowserTestBase::SetUpOnMainThread() { 514 void FileManagerBrowserTestBase::SetUpOnMainThread() {
510 ExtensionApiTest::SetUpOnMainThread(); 515 ExtensionApiTest::SetUpOnMainThread();
511 ASSERT_TRUE(local_volume_->Mount(profile())); 516 ASSERT_TRUE(local_volume_->Mount(profile()));
512 517
513 if (GetGuestModeParam() != IN_GUEST_MODE) { 518 if (GetGuestModeParam() != IN_GUEST_MODE) {
514 // Install the web server to serve the mocked share dialog. 519 // Install the web server to serve the mocked share dialog.
515 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 520 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
516 const GURL share_url_base(embedded_test_server()->GetURL( 521 const GURL share_url_base(embedded_test_server()->GetURL(
517 "/chromeos/file_manager/share_dialog_mock/index.html")); 522 "/chromeos/file_manager/share_dialog_mock/index.html"));
518 drive_volume_ = drive_volumes_[profile()->GetOriginalProfile()]; 523 drive_volume_ = drive_volumes_[profile()->GetOriginalProfile()];
519 drive_volume_->ConfigureShareUrlBase(share_url_base); 524 drive_volume_->ConfigureShareUrlBase(share_url_base);
520 test_util::WaitUntilDriveMountPointIsAdded(profile()); 525 test_util::WaitUntilDriveMountPointIsAdded(profile());
521 } 526 }
522
523 net::NetworkChangeNotifier::SetTestNotificationsOnly(true);
524 } 527 }
525 528
526 void FileManagerBrowserTestBase::SetUpCommandLine( 529 void FileManagerBrowserTestBase::SetUpCommandLine(
527 base::CommandLine* command_line) { 530 base::CommandLine* command_line) {
528 if (GetGuestModeParam() == IN_GUEST_MODE) { 531 if (GetGuestModeParam() == IN_GUEST_MODE) {
529 command_line->AppendSwitch(chromeos::switches::kGuestSession); 532 command_line->AppendSwitch(chromeos::switches::kGuestSession);
530 command_line->AppendSwitchNative(chromeos::switches::kLoginUser, ""); 533 command_line->AppendSwitchNative(chromeos::switches::kLoginUser, "");
531 command_line->AppendSwitch(switches::kIncognito); 534 command_line->AppendSwitch(switches::kIncognito);
532 } 535 }
533 if (GetGuestModeParam() == IN_INCOGNITO) { 536 if (GetGuestModeParam() == IN_INCOGNITO) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 } 721 }
719 722
720 drive::DriveIntegrationService* 723 drive::DriveIntegrationService*
721 FileManagerBrowserTestBase::CreateDriveIntegrationService(Profile* profile) { 724 FileManagerBrowserTestBase::CreateDriveIntegrationService(Profile* profile) {
722 drive_volumes_[profile->GetOriginalProfile()].reset(new DriveTestVolume()); 725 drive_volumes_[profile->GetOriginalProfile()].reset(new DriveTestVolume());
723 return drive_volumes_[profile->GetOriginalProfile()] 726 return drive_volumes_[profile->GetOriginalProfile()]
724 ->CreateDriveIntegrationService(profile); 727 ->CreateDriveIntegrationService(profile);
725 } 728 }
726 729
727 } // namespace file_manager 730 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698