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

Unified Diff: blimp/client/session/tab_control_feature_unittest.cc

Issue 1636163002: Restructure contents of blimp/client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « blimp/client/session/tab_control_feature_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/session/tab_control_feature_unittest.cc
diff --git a/blimp/client/session/tab_control_feature_unittest.cc b/blimp/client/session/tab_control_feature_unittest.cc
deleted file mode 100644
index e70be8801e3ccd0fb08b838a9c9a94331c866763..0000000000000000000000000000000000000000
--- a/blimp/client/session/tab_control_feature_unittest.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2015 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 "blimp/client/session/tab_control_feature.h"
-
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "blimp/common/proto/blimp_message.pb.h"
-#include "blimp/common/proto/tab_control.pb.h"
-#include "blimp/net/test_common.h"
-#include "net/base/net_errors.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/gfx/geometry/size.h"
-
-using testing::_;
-
-namespace blimp {
-namespace client {
-
-MATCHER_P3(EqualsSizeMessage, width, height, dp_to_px, "") {
- return arg.tab_control().type() == TabControlMessage::SIZE &&
- arg.tab_control().size().width() == width &&
- arg.tab_control().size().height() == height &&
- arg.tab_control().size().device_pixel_ratio() == dp_to_px;
-}
-
-class TabControlFeatureTest : public testing::Test {
- public:
- TabControlFeatureTest() : out_processor_(nullptr) {}
-
- void SetUp() override {
- out_processor_ = new MockBlimpMessageProcessor();
- feature_.set_outgoing_message_processor(make_scoped_ptr(out_processor_));
- }
-
- protected:
- // This is a raw pointer to a class that is owned by the ControlFeature.
- MockBlimpMessageProcessor* out_processor_;
-
- TabControlFeature feature_;
-};
-
-TEST_F(TabControlFeatureTest, CreatesCorrectSizeMessage) {
- uint64_t width = 10;
- uint64_t height = 15;
- float dp_to_px = 1.23f;
-
- EXPECT_CALL(
- *out_processor_,
- MockableProcessMessage(EqualsSizeMessage(width, height, dp_to_px), _))
- .Times(1);
- feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px);
-}
-
-TEST_F(TabControlFeatureTest, NoDuplicateSizeMessage) {
- uint64_t width = 10;
- uint64_t height = 15;
- float dp_to_px = 1.23f;
-
- EXPECT_CALL(
- *out_processor_,
- MockableProcessMessage(EqualsSizeMessage(width, height, dp_to_px), _))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(
- *out_processor_,
- MockableProcessMessage(EqualsSizeMessage(width, height, dp_to_px + 1), _))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*out_processor_,
- MockableProcessMessage(
- EqualsSizeMessage(width + 1, height, dp_to_px + 1), _))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*out_processor_,
- MockableProcessMessage(
- EqualsSizeMessage(width + 1, height + 1, dp_to_px + 1), _))
- .Times(1)
- .RetiresOnSaturation();
-
- feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px);
- feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px);
- feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px + 1);
- feature_.SetSizeAndScale(gfx::Size(width + 1, height), dp_to_px + 1);
- feature_.SetSizeAndScale(gfx::Size(width + 1, height + 1), dp_to_px + 1);
-}
-
-} // namespace client
-} // namespace blimp
« no previous file with comments | « blimp/client/session/tab_control_feature_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698