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

Side by Side Diff: blimp/client/feature/tab_control_feature_unittest.cc

Issue 1933053003: Used oneof in blimp_message.proto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "blimp/client/feature/tab_control_feature.h" 5 #include "blimp/client/feature/tab_control_feature.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "blimp/common/proto/blimp_message.pb.h" 11 #include "blimp/common/proto/blimp_message.pb.h"
12 #include "blimp/common/proto/tab_control.pb.h" 12 #include "blimp/common/proto/tab_control.pb.h"
13 #include "blimp/net/test_common.h" 13 #include "blimp/net/test_common.h"
14 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
15 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 #include "ui/gfx/geometry/size.h" 17 #include "ui/gfx/geometry/size.h"
18 18
19 using testing::_; 19 using testing::_;
20 20
21 namespace blimp { 21 namespace blimp {
22 namespace client { 22 namespace client {
23 23
24 MATCHER_P3(EqualsSizeMessage, width, height, dp_to_px, "") { 24 MATCHER_P3(EqualsSizeMessage, width, height, dp_to_px, "") {
25 return arg.tab_control().type() == TabControlMessage::SIZE && 25 return arg.tab_control().tab_control_case() == TabControlMessage::kSize &&
26 arg.tab_control().size().width() == width && 26 arg.tab_control().size().width() == width &&
27 arg.tab_control().size().height() == height && 27 arg.tab_control().size().height() == height &&
28 arg.tab_control().size().device_pixel_ratio() == dp_to_px; 28 arg.tab_control().size().device_pixel_ratio() == dp_to_px;
29 } 29 }
30 30
31 class TabControlFeatureTest : public testing::Test { 31 class TabControlFeatureTest : public testing::Test {
32 public: 32 public:
33 TabControlFeatureTest() : out_processor_(nullptr) {} 33 TabControlFeatureTest() : out_processor_(nullptr) {}
34 34
35 void SetUp() override { 35 void SetUp() override {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px); 85 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px);
86 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px); 86 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px);
87 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px + 1); 87 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px + 1);
88 feature_.SetSizeAndScale(gfx::Size(width + 1, height), dp_to_px + 1); 88 feature_.SetSizeAndScale(gfx::Size(width + 1, height), dp_to_px + 1);
89 feature_.SetSizeAndScale(gfx::Size(width + 1, height + 1), dp_to_px + 1); 89 feature_.SetSizeAndScale(gfx::Size(width + 1, height + 1), dp_to_px + 1);
90 } 90 }
91 91
92 } // namespace client 92 } // namespace client
93 } // namespace blimp 93 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/feature/tab_control_feature.cc ('k') | blimp/client/session/blimp_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698