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

Side by Side Diff: chrome/browser/sessions/session_restore_browsertest.cc

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: Created 4 years, 11 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 protected: 76 protected:
77 #if defined(OS_CHROMEOS) 77 #if defined(OS_CHROMEOS)
78 void SetUpCommandLine(base::CommandLine* command_line) override { 78 void SetUpCommandLine(base::CommandLine* command_line) override {
79 // TODO(nkostylev): Investigate if we can remove this switch. 79 // TODO(nkostylev): Investigate if we can remove this switch.
80 command_line->AppendSwitch(switches::kCreateBrowserOnStartupForTests); 80 command_line->AppendSwitch(switches::kCreateBrowserOnStartupForTests);
81 InProcessBrowserTest::SetUpCommandLine(command_line); 81 InProcessBrowserTest::SetUpCommandLine(command_line);
82 } 82 }
83 #endif 83 #endif
84 84
85 void SetUpOnMainThread() override { 85 void SetUpOnMainThread() override {
86 active_browser_list_ = BrowserList::GetInstance(chrome::GetActiveDesktop()); 86 active_browser_list_ = BrowserList::GetInstance();
87 87
88 SessionStartupPref pref(SessionStartupPref::LAST); 88 SessionStartupPref pref(SessionStartupPref::LAST);
89 SessionStartupPref::SetStartupPref(browser()->profile(), pref); 89 SessionStartupPref::SetStartupPref(browser()->profile(), pref);
90 #if defined(OS_CHROMEOS) 90 #if defined(OS_CHROMEOS)
91 const testing::TestInfo* const test_info = 91 const testing::TestInfo* const test_info =
92 testing::UnitTest::GetInstance()->current_test_info(); 92 testing::UnitTest::GetInstance()->current_test_info();
93 if (strcmp(test_info->name(), "NoSessionRestoreNewWindowChromeOS") != 0) { 93 if (strcmp(test_info->name(), "NoSessionRestoreNewWindowChromeOS") != 0) {
94 // Undo the effect of kBrowserAliveWithNoWindows in defaults.cc so that we 94 // Undo the effect of kBrowserAliveWithNoWindows in defaults.cc so that we
95 // can get these test to work without quitting. 95 // can get these test to work without quitting.
96 SessionServiceTestHelper helper( 96 SessionServiceTestHelper helper(
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 // automatically at the start of the test. 1434 // automatically at the start of the test.
1435 for (size_t i = 1; i < web_contents().size(); i++) { 1435 for (size_t i = 1; i < web_contents().size(); i++) {
1436 GURL expected_url = GURL(kUrls[activation_order[kExpectedNumTabs - i]]); 1436 GURL expected_url = GURL(kUrls[activation_order[kExpectedNumTabs - i]]);
1437 ASSERT_EQ(expected_url, web_contents()[i]->GetLastCommittedURL()); 1437 ASSERT_EQ(expected_url, web_contents()[i]->GetLastCommittedURL());
1438 if (i > 0) { 1438 if (i > 0) {
1439 ASSERT_GT(web_contents()[i - 1]->GetLastActiveTime(), 1439 ASSERT_GT(web_contents()[i - 1]->GetLastActiveTime(),
1440 web_contents()[i]->GetLastActiveTime()); 1440 web_contents()[i]->GetLastActiveTime());
1441 } 1441 }
1442 } 1442 }
1443 } 1443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698