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

Unified Diff: chrome/browser/thumbnails/render_widget_snapshot_taker_unittest.cc

Issue 154083008: Remove Tabpose feature on mac, and supporting infrastructure (PaintAtSize) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, merge Created 6 years, 10 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/thumbnails/render_widget_snapshot_taker_unittest.cc
diff --git a/chrome/browser/thumbnails/render_widget_snapshot_taker_unittest.cc b/chrome/browser/thumbnails/render_widget_snapshot_taker_unittest.cc
deleted file mode 100644
index d44a69bae14c090c300b393405293d2cfe776c56..0000000000000000000000000000000000000000
--- a/chrome/browser/thumbnails/render_widget_snapshot_taker_unittest.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2013 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/thumbnails/render_widget_snapshot_taker.h"
-
-#include "chrome/test/base/chrome_render_view_host_test_harness.h"
-
-class RenderWidgetSnapshotTakerTest : public ChromeRenderViewHostTestHarness {
- public:
- RenderWidgetSnapshotTakerTest() : snapshot_ready_called_(false) {}
-
- void SnapshotReady(const SkBitmap& bitmap) {
- snapshot_ready_called_ = true;
- }
-
- bool snapshot_ready_called() const {
- return snapshot_ready_called_;
- }
-
- private:
- bool snapshot_ready_called_;
-};
-
-#if defined(USE_X11)
-// RenderWidgetHost::AskForSnapshot is not implemented for X11
-// (http://crbug.com/89777).
-#define MAYBE_WidgetDidReceivePaintAtSizeAck \
- DISABLED_WidgetDidReceivePaintAtSizeAck
-#else
-#define MAYBE_WidgetDidReceivePaintAtSizeAck WidgetDidReceivePaintAtSizeAck
-#endif
-
-// Just checks the callback runs in WidgetDidReceivePaintAtSizeAck.
-TEST_F(RenderWidgetSnapshotTakerTest, MAYBE_WidgetDidReceivePaintAtSizeAck) {
- RenderWidgetSnapshotTaker snapshot_taker;
- const gfx::Size size(100, 100);
- snapshot_taker.AskForSnapshot(
- rvh(),
- base::Bind(&RenderWidgetSnapshotTakerTest::SnapshotReady,
- base::Unretained(this)),
- size,
- size);
- EXPECT_EQ(1U, snapshot_taker.callback_map_.size());
- const int sequence_num = 1;
- snapshot_taker.WidgetDidReceivePaintAtSizeAck(
- content::RenderViewHostTestHarness::rvh(),
- sequence_num,
- size);
- EXPECT_TRUE(snapshot_taker.callback_map_.empty());
- EXPECT_TRUE(snapshot_ready_called());
-}
-
-#if defined(USE_X11)
-// RenderWidgetHost::AskForSnapshot is not implemented for X11
-// (http://crbug.com/89777).
-#define MAYBE_WidgetDidReceivePaintAtSizeAckFail \
- DISABLED_WidgetDidReceivePaintAtSizeAckFail
-#else
-#define MAYBE_WidgetDidReceivePaintAtSizeAckFail \
- WidgetDidReceivePaintAtSizeAckFail
-#endif
-
-// Checks the case where RenderWidgetSnapshotTaker receives an ack with a wrong
-// size. The should result in a failure and the callback should not be called.
-TEST_F(RenderWidgetSnapshotTakerTest,
- MAYBE_WidgetDidReceivePaintAtSizeAckFail) {
- RenderWidgetSnapshotTaker snapshot_taker;
- const gfx::Size size(100, 100);
- snapshot_taker.AskForSnapshot(
- rvh(),
- base::Bind(&RenderWidgetSnapshotTakerTest::SnapshotReady,
- base::Unretained(this)),
- size,
- size);
- EXPECT_EQ(1U, snapshot_taker.callback_map_.size());
- const int sequence_num = 1;
- // Ensure this is bigger than the max scale factor X the size.
- const gfx::Size size2(300, 300);
- snapshot_taker.WidgetDidReceivePaintAtSizeAck(
- content::RenderViewHostTestHarness::rvh(),
- sequence_num,
- size2);
- EXPECT_FALSE(snapshot_taker.callback_map_.empty());
- EXPECT_FALSE(snapshot_ready_called());
-}
« no previous file with comments | « chrome/browser/thumbnails/render_widget_snapshot_taker.cc ('k') | chrome/browser/thumbnails/thumbnail_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698