| OLD | NEW |
| 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/session/tab_control_feature.h" | 5 #include "blimp/client/session/tab_control_feature.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "blimp/common/proto/blimp_message.pb.h" | 9 #include "blimp/common/proto/blimp_message.pb.h" |
| 10 #include "blimp/common/proto/tab_control.pb.h" | 10 #include "blimp/common/proto/tab_control.pb.h" |
| 11 #include "blimp/net/test_common.h" | 11 #include "blimp/net/test_common.h" |
| 12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| 16 | 16 |
| 17 using testing::_; | 17 using testing::_; |
| 18 | 18 |
| 19 namespace blimp { | 19 namespace blimp { |
| 20 namespace client { |
| 20 | 21 |
| 21 MATCHER_P3(EqualsSizeMessage, width, height, dp_to_px, "") { | 22 MATCHER_P3(EqualsSizeMessage, width, height, dp_to_px, "") { |
| 22 return arg.tab_control().type() == TabControlMessage::SIZE && | 23 return arg.tab_control().type() == TabControlMessage::SIZE && |
| 23 arg.tab_control().size().width() == width && | 24 arg.tab_control().size().width() == width && |
| 24 arg.tab_control().size().height() == height && | 25 arg.tab_control().size().height() == height && |
| 25 arg.tab_control().size().device_pixel_ratio() == dp_to_px; | 26 arg.tab_control().size().device_pixel_ratio() == dp_to_px; |
| 26 } | 27 } |
| 27 | 28 |
| 28 class TabControlFeatureTest : public testing::Test { | 29 class TabControlFeatureTest : public testing::Test { |
| 29 public: | 30 public: |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 .Times(1) | 80 .Times(1) |
| 80 .RetiresOnSaturation(); | 81 .RetiresOnSaturation(); |
| 81 | 82 |
| 82 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px); | 83 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px); |
| 83 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px); | 84 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px); |
| 84 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px + 1); | 85 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px + 1); |
| 85 feature_.SetSizeAndScale(gfx::Size(width + 1, height), dp_to_px + 1); | 86 feature_.SetSizeAndScale(gfx::Size(width + 1, height), dp_to_px + 1); |
| 86 feature_.SetSizeAndScale(gfx::Size(width + 1, height + 1), dp_to_px + 1); | 87 feature_.SetSizeAndScale(gfx::Size(width + 1, height + 1), dp_to_px + 1); |
| 87 } | 88 } |
| 88 | 89 |
| 90 } // namespace client |
| 89 } // namespace blimp | 91 } // namespace blimp |
| OLD | NEW |