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

Unified Diff: chrome/browser/sessions/session_service_unittest.cc

Issue 7621061: Restoring a session should restore window minimization state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing Mark's comments. Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sessions/session_service.cc ('k') | chrome/browser/sessions/session_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_service_unittest.cc
diff --git a/chrome/browser/sessions/session_service_unittest.cc b/chrome/browser/sessions/session_service_unittest.cc
index b6af02e04643d58c81bb321d4fb43e899d30bdcc..4fc561e29010c0aba6bd1bf21220dd64cfea22bb 100644
--- a/chrome/browser/sessions/session_service_unittest.cc
+++ b/chrome/browser/sessions/session_service_unittest.cc
@@ -45,7 +45,9 @@ class SessionServiceTest : public BrowserWithTestWindowTest,
helper_.set_service(session_service);
service()->SetWindowType(window_id, Browser::TYPE_TABBED);
- service()->SetWindowBounds(window_id, window_bounds, false);
+ service()->SetWindowBounds(window_id,
+ window_bounds,
+ ui::SHOW_STATE_NORMAL);
}
// Upon notification, increment the sync_save_count variable
@@ -268,7 +270,9 @@ TEST_F(SessionServiceTest, TwoWindows) {
const gfx::Rect window2_bounds(3, 4, 5, 6);
service()->SetWindowType(window2_id, Browser::TYPE_TABBED);
- service()->SetWindowBounds(window2_id, window2_bounds, true);
+ service()->SetWindowBounds(window2_id,
+ window2_bounds,
+ ui::SHOW_STATE_MAXIMIZED);
helper_.PrepareTabInWindow(window2_id, tab2_id, 0, true);
UpdateNavigation(window2_id, tab2_id, nav2, 0, true);
@@ -285,15 +289,15 @@ TEST_F(SessionServiceTest, TwoWindows) {
SessionTab* rt2;
if (windows[0]->window_id.id() == window_id.id()) {
ASSERT_EQ(window2_id.id(), windows[1]->window_id.id());
- ASSERT_FALSE(windows[0]->is_maximized);
- ASSERT_TRUE(windows[1]->is_maximized);
+ ASSERT_EQ(ui::SHOW_STATE_NORMAL, windows[0]->show_state);
+ ASSERT_EQ(ui::SHOW_STATE_MAXIMIZED, windows[1]->show_state);
rt1 = windows[0]->tabs[0];
rt2 = windows[1]->tabs[0];
} else {
ASSERT_EQ(window2_id.id(), windows[0]->window_id.id());
ASSERT_EQ(window_id.id(), windows[1]->window_id.id());
- ASSERT_TRUE(windows[0]->is_maximized);
- ASSERT_FALSE(windows[1]->is_maximized);
+ ASSERT_EQ(ui::SHOW_STATE_MAXIMIZED, windows[0]->show_state);
+ ASSERT_EQ(ui::SHOW_STATE_NORMAL, windows[1]->show_state);
rt1 = windows[1]->tabs[0];
rt2 = windows[0]->tabs[0];
}
@@ -320,7 +324,9 @@ TEST_F(SessionServiceTest, WindowWithNoTabsGetsPruned) {
const gfx::Rect window2_bounds(3, 4, 5, 6);
service()->SetWindowType(window2_id, Browser::TYPE_TABBED);
- service()->SetWindowBounds(window2_id, window2_bounds, false);
+ service()->SetWindowBounds(window2_id,
+ window2_bounds,
+ ui::SHOW_STATE_NORMAL);
helper_.PrepareTabInWindow(window2_id, tab2_id, 0, true);
ScopedVector<SessionWindow> windows;
@@ -380,7 +386,9 @@ TEST_F(SessionServiceTest, WindowCloseCommittedAfterNavigate) {
ASSERT_NE(window2_id.id(), window_id.id());
service()->SetWindowType(window2_id, Browser::TYPE_TABBED);
- service()->SetWindowBounds(window2_id, window_bounds, false);
+ service()->SetWindowBounds(window2_id,
+ window_bounds,
+ ui::SHOW_STATE_NORMAL);
TabNavigation nav1(0, GURL("http://google.com"), GURL(),
ASCIIToUTF16("abc"), "def",
@@ -423,7 +431,9 @@ TEST_F(SessionServiceTest, IgnorePopups) {
ASSERT_NE(window2_id.id(), window_id.id());
service()->SetWindowType(window2_id, Browser::TYPE_POPUP);
- service()->SetWindowBounds(window2_id, window_bounds, false);
+ service()->SetWindowBounds(window2_id,
+ window_bounds,
+ ui::SHOW_STATE_NORMAL);
TabNavigation nav1(0, GURL("http://google.com"), GURL(),
ASCIIToUTF16("abc"), "def",
@@ -462,7 +472,9 @@ TEST_F(SessionServiceTest, RestorePopup) {
ASSERT_NE(window2_id.id(), window_id.id());
service()->SetWindowType(window2_id, Browser::TYPE_POPUP);
- service()->SetWindowBounds(window2_id, window_bounds, false);
+ service()->SetWindowBounds(window2_id,
+ window_bounds,
+ ui::SHOW_STATE_NORMAL);
TabNavigation nav1(0, GURL("http://google.com"), GURL(),
ASCIIToUTF16("abc"), "def",
« no previous file with comments | « chrome/browser/sessions/session_service.cc ('k') | chrome/browser/sessions/session_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698