summaryrefslogtreecommitdiffstats
path: root/apps/shell_window_geometry_cache_unittest.cc
diff options
context:
space:
mode:
authorscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-21 03:46:16 +0000
committerscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-21 03:46:16 +0000
commit9c87b3da2046e3ae25496da12d2d6a50697a3430 (patch)
treec40d7f23498b5f3b8cb799a5be1d5ad9f35a3045 /apps/shell_window_geometry_cache_unittest.cc
parent9a9ac159cb23f40be409ce1ea8f029e9c7f9a174 (diff)
downloadchromium_src-9c87b3da2046e3ae25496da12d2d6a50697a3430.zip
chromium_src-9c87b3da2046e3ae25496da12d2d6a50697a3430.tar.gz
chromium_src-9c87b3da2046e3ae25496da12d2d6a50697a3430.tar.bz2
DCHECK that invalid app window states are not cached.
Initial change to protect against loading invalid cached state should have included these DCHECKs: https://chromiumcodereview.appspot.com/21444002 BUG=266578,269040 Review URL: https://chromiumcodereview.appspot.com/22611004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/shell_window_geometry_cache_unittest.cc')
-rw-r--r--apps/shell_window_geometry_cache_unittest.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/shell_window_geometry_cache_unittest.cc b/apps/shell_window_geometry_cache_unittest.cc
index 98c4bdc..2b42d48 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.