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

Unified Diff: trunk/src/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 23304003: Revert 218338 "Resubmit issue to fix issue where window bounds w..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 | « trunk/src/content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
===================================================================
--- trunk/src/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc (revision 218364)
+++ trunk/src/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc (working copy)
@@ -17,7 +17,6 @@
#include "ipc/ipc_test_sink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/client/aura_constants.h"
-#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
#include "ui/aura/layout_manager.h"
#include "ui/aura/root_window.h"
@@ -33,36 +32,6 @@
namespace content {
namespace {
-
-// Simple screen position client to test coordinate system conversion.
-class TestScreenPositionClient
- : public aura::client::ScreenPositionClient {
- public:
- TestScreenPositionClient() {}
- virtual ~TestScreenPositionClient() {}
-
- // aura::client::ScreenPositionClient overrides:
- virtual void ConvertPointToScreen(const aura::Window* window,
- gfx::Point* point) OVERRIDE {
- point->Offset(-1, -1);
- }
-
- virtual void ConvertPointFromScreen(const aura::Window* window,
- gfx::Point* point) OVERRIDE {
- point->Offset(1, 1);
- }
-
- virtual void ConvertHostPointToScreen(aura::RootWindow* window,
- gfx::Point* point) OVERRIDE {
- ConvertPointToScreen(window, point);
- }
-
- virtual void SetBounds(aura::Window* window,
- const gfx::Rect& bounds,
- const gfx::Display& display) OVERRIDE {
- }
-};
-
class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate {
public:
MockRenderWidgetHostDelegate() {}
@@ -220,46 +189,6 @@
EXPECT_TRUE(view_->ShouldActivate());
}
-// Checks that a popup is positioned correctly relative to its parent using
-// screen coordinates.
-TEST_F(RenderWidgetHostViewAuraTest, PositionChildPopup) {
- TestScreenPositionClient screen_position_client;
-
- aura::Window* window = parent_view_->GetNativeView();
- aura::RootWindow* root = window->GetRootWindow();
- aura::client::SetScreenPositionClient(root, &screen_position_client);
-
- parent_view_->SetBounds(gfx::Rect(10, 10, 800, 600));
- gfx::Rect bounds_in_screen = parent_view_->GetViewBounds();
- int horiz = bounds_in_screen.width() / 4;
- int vert = bounds_in_screen.height() / 4;
- bounds_in_screen.Inset(horiz, vert);
-
- // Verify that when the popup is initialized for the first time, it correctly
- // treats the input bounds as screen coordinates.
- view_->InitAsPopup(parent_view_, bounds_in_screen);
- gfx::Rect final_bounds_in_screen = view_->GetViewBounds();
- EXPECT_EQ(final_bounds_in_screen.ToString(), bounds_in_screen.ToString());
-
- // Verify that directly setting the bounds via SetBounds() treats the input
- // as screen coordinates.
- bounds_in_screen = gfx::Rect(60, 60, 100, 100);
- view_->SetBounds(bounds_in_screen);
- final_bounds_in_screen = view_->GetViewBounds();
- EXPECT_EQ(final_bounds_in_screen.ToString(), bounds_in_screen.ToString());
-
- // Verify that setting the size does not alter the origin.
- gfx::Point original_origin = window->bounds().origin();
- view_->SetSize(gfx::Size(120, 120));
- gfx::Point new_origin = window->bounds().origin();
- EXPECT_EQ(original_origin.ToString(), new_origin.ToString());
-
- aura::client::SetScreenPositionClient(root, NULL);
-
- widget_host_ = NULL;
- view_ = NULL;
-}
-
// Checks that a fullscreen view is destroyed when it loses the focus.
TEST_F(RenderWidgetHostViewAuraTest, DestroyFullscreenOnBlur) {
view_->InitAsFullscreen(parent_view_);
« no previous file with comments | « trunk/src/content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698