OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/tabs/touch_tab_strip_layout.h" | 5 #include "chrome/browser/ui/views/tabs/touch_tab_strip_layout.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 } | 225 } |
226 | 226 |
227 // Assertions for AddTab(). | 227 // Assertions for AddTab(). |
228 TEST_F(TouchTabStripLayoutTest, AddTab) { | 228 TEST_F(TouchTabStripLayoutTest, AddTab) { |
229 struct TestData { | 229 struct TestData { |
230 CommonTestData common_data; | 230 CommonTestData common_data; |
231 int add_index; | 231 int add_index; |
232 bool add_active; | 232 bool add_active; |
233 bool add_mini; | 233 bool add_mini; |
234 } test_data[] = { | 234 } test_data[] = { |
| 235 // Adding a background tab test cases. |
| 236 { { 0, 300, 100, -10, 2, 0, 1, "0 90 180 198 200", "0 16 106 196 198 200"}, |
| 237 3, false, false }, |
| 238 { { 0, 300, 100, -10, 2, 0, 1, "0 90 180 198 200", "0 2 4 20 110 200"}, |
| 239 5, false, false }, |
| 240 { { 0, 300, 100, -10, 2, 0, 1, "0 90 180 198 200", "0 90 180 196 198 200"}, |
| 241 2, false, false }, |
| 242 { { 0, 300, 100, -10, 2, 0, 1, "0 90 180 198 200", "0 2 4 94 184 200"}, |
| 243 0, false, false }, |
| 244 |
235 { { 4, 200, 100, -10, 2, 1, 2, "0 4 10 100", "0 0 8 10 100"}, | 245 { { 4, 200, 100, -10, 2, 1, 2, "0 4 10 100", "0 0 8 10 100"}, |
236 1, false, true }, | 246 1, false, true }, |
237 { { 4, 200, 100, -10, 2, 1, 2, "0 4 10 100", "0 0 8 98 100"}, | 247 { { 4, 200, 100, -10, 2, 1, 2, "0 4 10 100", "0 0 8 98 100"}, |
238 1, true, true }, | 248 1, true, true }, |
239 { { 4, 200, 100, -10, 2, 1, 2, "0 4 10 100", "0 0 8 98 100"}, | 249 { { 4, 200, 100, -10, 2, 1, 2, "0 4 10 100", "0 0 8 98 100"}, |
240 0, true, true }, | 250 0, true, true }, |
241 { { 0, 200, 100, -10, 2, 0, 2, "0 2 10 100", "0 4 94 98 100"}, | 251 { { 0, 200, 100, -10, 2, 0, 2, "0 2 10 100", "0 4 94 98 100"}, |
242 0, true, true }, | 252 0, true, true }, |
243 | 253 |
244 { { 0, 200, 100, -10, 2, 0, 0, "0 90 92 92 94 96 98 100", | 254 { { 0, 200, 100, -10, 2, 0, 0, "0 90 92 92 94 96 98 100", |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 464 |
455 // Assertions around SetXAndMiniCount. | 465 // Assertions around SetXAndMiniCount. |
456 TEST_F(TouchTabStripLayoutTest, SetXAndMiniCount) { | 466 TEST_F(TouchTabStripLayoutTest, SetXAndMiniCount) { |
457 // Verifies we don't crash when transitioning to all mini-tabs. | 467 // Verifies we don't crash when transitioning to all mini-tabs. |
458 PrepareChildViews(1); | 468 PrepareChildViews(1); |
459 layout_.reset(new TouchTabStripLayout( | 469 layout_.reset(new TouchTabStripLayout( |
460 gfx::Size(100, 10), -10, 2, 4, &view_model_)); | 470 gfx::Size(100, 10), -10, 2, 4, &view_model_)); |
461 Reset(layout_.get(), 0, 400, 0, 0); | 471 Reset(layout_.get(), 0, 400, 0, 0); |
462 layout_->SetXAndMiniCount(0, 1); | 472 layout_->SetXAndMiniCount(0, 1); |
463 } | 473 } |
OLD | NEW |