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

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

Issue 2685333005: ash: fix regression where ctrl+n put new window on wrong desktop (Closed)
Patch Set: Rebase to ToT 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
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 <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 ui_test_utils::NavigateToURL(browser(), url); 480 ui_test_utils::NavigateToURL(browser(), url);
481 481
482 // Turn on session restore. 482 // Turn on session restore.
483 SessionStartupPref::SetStartupPref( 483 SessionStartupPref::SetStartupPref(
484 browser()->profile(), 484 browser()->profile(),
485 SessionStartupPref(SessionStartupPref::LAST)); 485 SessionStartupPref(SessionStartupPref::LAST));
486 486
487 // Create a new popup. 487 // Create a new popup.
488 Profile* profile = browser()->profile(); 488 Profile* profile = browser()->profile();
489 Browser* popup = 489 Browser* popup =
490 new Browser(Browser::CreateParams(Browser::TYPE_POPUP, profile)); 490 new Browser(Browser::CreateParams(Browser::TYPE_POPUP, profile, true));
491 popup->window()->Show(); 491 popup->window()->Show();
492 492
493 // Close the browser. 493 // Close the browser.
494 CloseBrowserSynchronously(browser()); 494 CloseBrowserSynchronously(browser());
495 495
496 // Create a new window, which should trigger session restore. 496 // Create a new window, which should trigger session restore.
497 ui_test_utils::BrowserAddedObserver observer; 497 ui_test_utils::BrowserAddedObserver observer;
498 chrome::NewWindow(popup); 498 chrome::NewWindow(popup);
499 Browser* new_browser = observer.WaitForSingleNewBrowser(); 499 Browser* new_browser = observer.WaitForSingleNewBrowser();
500 500
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 // automatically at the start of the test. 1611 // automatically at the start of the test.
1612 for (size_t i = 1; i < web_contents().size(); i++) { 1612 for (size_t i = 1; i < web_contents().size(); i++) {
1613 GURL expected_url = GURL(kUrls[activation_order[kExpectedNumTabs - i]]); 1613 GURL expected_url = GURL(kUrls[activation_order[kExpectedNumTabs - i]]);
1614 ASSERT_EQ(expected_url, web_contents()[i]->GetLastCommittedURL()); 1614 ASSERT_EQ(expected_url, web_contents()[i]->GetLastCommittedURL());
1615 if (i > 0) { 1615 if (i > 0) {
1616 ASSERT_GT(web_contents()[i - 1]->GetLastActiveTime(), 1616 ASSERT_GT(web_contents()[i - 1]->GetLastActiveTime(),
1617 web_contents()[i]->GetLastActiveTime()); 1617 web_contents()[i]->GetLastActiveTime());
1618 } 1618 }
1619 } 1619 }
1620 } 1620 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_restore.cc ('k') | chrome/browser/sessions/session_restore_browsertest_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698