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

Unified Diff: apps/shell_window_geometry_cache_unittest.cc

Issue 22611004: DCHECK that invalid app window states are not cached. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « apps/shell_window_geometry_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/shell_window_geometry_cache_unittest.cc
diff --git a/apps/shell_window_geometry_cache_unittest.cc b/apps/shell_window_geometry_cache_unittest.cc
index 98c4bdca5947ccc0a0e9552f53e7b0a39e57becb..2b42d48d43afc87263cc74a6b01b582d1084a3b2 100644
--- a/apps/shell_window_geometry_cache_unittest.cc
+++ b/apps/shell_window_geometry_cache_unittest.cc
@@ -108,7 +108,7 @@ TEST_F(ShellWindowGeometryCacheTest, GetGeometryUnkownExtension) {
AddGeometryAndLoadExtension(extension_id1, kWindowId,
gfx::Rect(4, 5, 31, 43),
gfx::Rect(0, 0, 1600, 900),
- ui::SHOW_STATE_DEFAULT);
+ ui::SHOW_STATE_NORMAL);
ASSERT_FALSE(cache_->GetGeometry(extension_id2, kWindowId, NULL, NULL, NULL));
}
@@ -118,7 +118,7 @@ TEST_F(ShellWindowGeometryCacheTest, GetGeometryUnkownWindow) {
AddGeometryAndLoadExtension(extension_id, kWindowId,
gfx::Rect(4, 5, 31, 43),
gfx::Rect(0, 0, 1600, 900),
- ui::SHOW_STATE_DEFAULT);
+ ui::SHOW_STATE_NORMAL);
ASSERT_FALSE(cache_->GetGeometry(extension_id, kWindowId2, NULL, NULL, NULL));
}
@@ -282,28 +282,28 @@ TEST_F(ShellWindowGeometryCacheTest, NoDuplicateWrites) {
// Write the first bounds - it should do > 0 writes.
EXPECT_CALL(observer, OnPreferenceChanged(_));
cache_->SaveGeometry(extension_id, kWindowId, bounds1,
- screen_bounds1, ui::SHOW_STATE_DEFAULT);
+ screen_bounds1, ui::SHOW_STATE_NORMAL);
WaitForSync();
Mock::VerifyAndClearExpectations(&observer);
// Write a different bounds - it should also do > 0 writes.
EXPECT_CALL(observer, OnPreferenceChanged(_));
cache_->SaveGeometry(extension_id, kWindowId, bounds2,
- screen_bounds1, ui::SHOW_STATE_DEFAULT);
+ screen_bounds1, ui::SHOW_STATE_NORMAL);
WaitForSync();
Mock::VerifyAndClearExpectations(&observer);
// Write a different screen bounds - it should also do > 0 writes.
EXPECT_CALL(observer, OnPreferenceChanged(_));
cache_->SaveGeometry(extension_id, kWindowId, bounds2,
- screen_bounds2, ui::SHOW_STATE_DEFAULT);
+ screen_bounds2, ui::SHOW_STATE_NORMAL);
WaitForSync();
Mock::VerifyAndClearExpectations(&observer);
// Write a different state - it should also do > 0 writes.
EXPECT_CALL(observer, OnPreferenceChanged(_));
cache_->SaveGeometry(extension_id, kWindowId, bounds2,
- screen_bounds2, ui::SHOW_STATE_NORMAL);
+ screen_bounds2, ui::SHOW_STATE_MAXIMIZED);
WaitForSync();
Mock::VerifyAndClearExpectations(&observer);
@@ -311,7 +311,7 @@ TEST_F(ShellWindowGeometryCacheTest, NoDuplicateWrites) {
// already have. This should not do any writes.
EXPECT_CALL(observer, OnPreferenceChanged(_)).Times(0);
cache_->SaveGeometry(extension_id, kWindowId, bounds2_duplicate,
- screen_bounds2_duplicate, ui::SHOW_STATE_NORMAL);
+ screen_bounds2_duplicate, ui::SHOW_STATE_MAXIMIZED);
WaitForSync();
Mock::VerifyAndClearExpectations(&observer);
}
@@ -327,7 +327,7 @@ TEST_F(ShellWindowGeometryCacheTest, MaxWindows) {
for (size_t i = 0; i < ShellWindowGeometryCache::kMaxCachedWindows + 1; ++i) {
std::string window_id = "window_" + base::IntToString(i);
cache_->SaveGeometry(extension_id, window_id, bounds,
- screen_bounds, ui::SHOW_STATE_DEFAULT);
+ screen_bounds, ui::SHOW_STATE_NORMAL);
}
// The first added window should no longer have cached geometry.
« no previous file with comments | « apps/shell_window_geometry_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698