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

Side by Side Diff: blimp/client/core/contents/tab_control_feature_unittest.cc

Issue 2313133002: Fix crashers and issues when rendering blimp in tabs (Closed)
Patch Set: Created 4 years, 3 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/core/contents/tab_control_feature.h" 5 #include "blimp/client/core/contents/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"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 uint64_t height = 15; 49 uint64_t height = 15;
50 float dp_to_px = 1.23f; 50 float dp_to_px = 1.23f;
51 51
52 EXPECT_CALL( 52 EXPECT_CALL(
53 *out_processor_, 53 *out_processor_,
54 MockableProcessMessage(EqualsSizeMessage(width, height, dp_to_px), _)) 54 MockableProcessMessage(EqualsSizeMessage(width, height, dp_to_px), _))
55 .Times(1); 55 .Times(1);
56 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px); 56 feature_.SetSizeAndScale(gfx::Size(width, height), dp_to_px);
57 } 57 }
58 58
59 TEST_F(TabControlFeatureTest, NoDuplicateSizeMessage) { 59 TEST_F(TabControlFeatureTest, EnsureDuplicateSizeMessageAllowed) {
60 uint64_t width = 10; 60 uint64_t width = 10;
61 uint64_t height = 15; 61 uint64_t height = 15;
62 float dp_to_px = 1.23f; 62 float dp_to_px = 1.23f;
63 63
64 EXPECT_CALL( 64 EXPECT_CALL(
65 *out_processor_, 65 *out_processor_,
66 MockableProcessMessage(EqualsSizeMessage(width, height, dp_to_px), _)) 66 MockableProcessMessage(EqualsSizeMessage(width, height, dp_to_px), _))
67 .Times(1) 67 .Times(2)
68 .RetiresOnSaturation(); 68 .RetiresOnSaturation();
69 EXPECT_CALL( 69 EXPECT_CALL(
70 *out_processor_, 70 *out_processor_,
71 MockableProcessMessage(EqualsSizeMessage(width, height, dp_to_px + 1), _)) 71 MockableProcessMessage(EqualsSizeMessage(width, height, dp_to_px + 1), _))
72 .Times(1) 72 .Times(2)
73 .RetiresOnSaturation(); 73 .RetiresOnSaturation();
74 EXPECT_CALL(*out_processor_, 74 EXPECT_CALL(*out_processor_,
75 MockableProcessMessage( 75 MockableProcessMessage(
76 EqualsSizeMessage(width + 1, height, dp_to_px + 1), _)) 76 EqualsSizeMessage(width + 1, height, dp_to_px + 1), _))
77 .Times(1) 77 .Times(2)
78 .RetiresOnSaturation(); 78 .RetiresOnSaturation();
79 EXPECT_CALL(*out_processor_, 79 EXPECT_CALL(*out_processor_,
80 MockableProcessMessage( 80 MockableProcessMessage(
81 EqualsSizeMessage(width + 1, height + 1, dp_to_px + 1), _)) 81 EqualsSizeMessage(width + 1, height + 1, dp_to_px + 1), _))
82 .Times(1) 82 .Times(2)
83 .RetiresOnSaturation(); 83 .RetiresOnSaturation();
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, 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), dp_to_px + 1);
90 feature_.SetSizeAndScale(gfx::Size(width + 1, height), dp_to_px + 1);
91 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); 92 feature_.SetSizeAndScale(gfx::Size(width + 1, height + 1), dp_to_px + 1);
90 } 93 }
91 94
92 } // namespace client 95 } // namespace client
93 } // namespace blimp 96 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/core/contents/tab_control_feature.cc ('k') | blimp/client/core/render_widget/render_widget_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698