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

Unified Diff: chrome/browser/devtools/devtools_contents_resizing_strategy_unittest.cc

Issue 440663003: DevTools: remove unused resizing strategy code paths, make it solely bounds-based. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for landing Created 6 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
Index: chrome/browser/devtools/devtools_contents_resizing_strategy_unittest.cc
diff --git a/chrome/browser/devtools/devtools_contents_resizing_strategy_unittest.cc b/chrome/browser/devtools/devtools_contents_resizing_strategy_unittest.cc
deleted file mode 100644
index a82f0242b06fc46290cdfeef31cf34b26de0aaa8..0000000000000000000000000000000000000000
--- a/chrome/browser/devtools/devtools_contents_resizing_strategy_unittest.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/devtools/devtools_contents_resizing_strategy.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(DevToolsContentsResizingStrategyTest, ApplyZero) {
- DevToolsContentsResizingStrategy zeroStrategy;
- gfx::Size container_size(100, 200);
- gfx::Rect old_devtools_bounds(0, 0, 100, 200);
- gfx::Rect old_contents_bounds(20, 20, 60, 140);
- gfx::Rect new_devtools_bounds;
- gfx::Rect new_contents_bounds;
- ApplyDevToolsContentsResizingStrategy(
- zeroStrategy, container_size,
- old_devtools_bounds, old_contents_bounds,
- &new_devtools_bounds, &new_contents_bounds);
- EXPECT_EQ(gfx::Rect(0, 0, 100, 200), new_devtools_bounds);
- EXPECT_EQ(gfx::Rect(0, 0, 100, 200), new_contents_bounds);
-}
-
-TEST(DevToolsContentsResizingStrategyTest, ApplyInsets) {
- DevToolsContentsResizingStrategy strategy(
- gfx::Insets(10, 20, 30, 40), gfx::Size(0, 0));
- gfx::Size container_size(100, 200);
- gfx::Rect old_devtools_bounds(0, 0, 100, 200);
- gfx::Rect old_contents_bounds(20, 20, 60, 140);
- gfx::Rect new_devtools_bounds;
- gfx::Rect new_contents_bounds;
- ApplyDevToolsContentsResizingStrategy(
- strategy, container_size,
- old_devtools_bounds, old_contents_bounds,
- &new_devtools_bounds, &new_contents_bounds);
- EXPECT_EQ(gfx::Rect(0, 0, 100, 200), new_devtools_bounds);
- EXPECT_EQ(gfx::Rect(20, 10, 40, 160), new_contents_bounds);
-}
-
-TEST(DevToolsContentsResizingStrategyTest, ApplyMinSize) {
- DevToolsContentsResizingStrategy strategy(
- gfx::Insets(10, 20, 90, 30), gfx::Size(60, 120));
- gfx::Size container_size(100, 200);
- gfx::Rect old_devtools_bounds(0, 0, 100, 200);
- gfx::Rect old_contents_bounds(20, 20, 60, 140);
- gfx::Rect new_devtools_bounds;
- gfx::Rect new_contents_bounds;
- ApplyDevToolsContentsResizingStrategy(
- strategy, container_size,
- old_devtools_bounds, old_contents_bounds,
- &new_devtools_bounds, &new_contents_bounds);
- EXPECT_EQ(gfx::Rect(0, 0, 100, 200), new_devtools_bounds);
- EXPECT_EQ(gfx::Rect(16, 8, 60, 120), new_contents_bounds);
-}
-
-TEST(DevToolsContentsResizingStrategyTest, ApplyLargeInset) {
- DevToolsContentsResizingStrategy strategy(
- gfx::Insets(0, 130, 0, 0), gfx::Size(60, 120));
- gfx::Size container_size(100, 200);
- gfx::Rect old_devtools_bounds(0, 0, 100, 200);
- gfx::Rect old_contents_bounds(20, 20, 60, 140);
- gfx::Rect new_devtools_bounds;
- gfx::Rect new_contents_bounds;
- ApplyDevToolsContentsResizingStrategy(
- strategy, container_size,
- old_devtools_bounds, old_contents_bounds,
- &new_devtools_bounds, &new_contents_bounds);
- EXPECT_EQ(gfx::Rect(0, 0, 100, 200), new_devtools_bounds);
- EXPECT_EQ(gfx::Rect(40, 0, 60, 200), new_contents_bounds);
-}
-
-TEST(DevToolsContentsResizingStrategyTest, ApplyTwoLargeInsets) {
- DevToolsContentsResizingStrategy strategy(
- gfx::Insets(120, 0, 80, 0), gfx::Size(60, 120));
- gfx::Size container_size(100, 200);
- gfx::Rect old_devtools_bounds(0, 0, 100, 200);
- gfx::Rect old_contents_bounds(20, 20, 60, 140);
- gfx::Rect new_devtools_bounds;
- gfx::Rect new_contents_bounds;
- ApplyDevToolsContentsResizingStrategy(
- strategy, container_size,
- old_devtools_bounds, old_contents_bounds,
- &new_devtools_bounds, &new_contents_bounds);
- EXPECT_EQ(gfx::Rect(0, 0, 100, 200), new_devtools_bounds);
- EXPECT_EQ(gfx::Rect(0, 48, 100, 120), new_contents_bounds);
-}
-
-TEST(DevToolsContentsResizingStrategyTest, ApplySmallContainer) {
- DevToolsContentsResizingStrategy strategy(
- gfx::Insets(10, 10, 10, 10), gfx::Size(120, 230));
- gfx::Size container_size(100, 200);
- gfx::Rect old_devtools_bounds(0, 0, 100, 200);
- gfx::Rect old_contents_bounds(20, 20, 60, 140);
- gfx::Rect new_devtools_bounds;
- gfx::Rect new_contents_bounds;
- ApplyDevToolsContentsResizingStrategy(
- strategy, container_size,
- old_devtools_bounds, old_contents_bounds,
- &new_devtools_bounds, &new_contents_bounds);
- EXPECT_EQ(gfx::Rect(0, 0, 100, 200), new_devtools_bounds);
- EXPECT_EQ(gfx::Rect(0, 0, 100, 200), new_contents_bounds);
-}

Powered by Google App Engine
This is Rietveld 408576698