OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/toolbar/toolbar_actions_bar_unittest.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 // Test drag-and-drop logic. | 313 // Test drag-and-drop logic. |
314 const char kExtension0[] = "extension 0"; | 314 const char kExtension0[] = "extension 0"; |
315 const char kExtension1[] = "extension 1"; | 315 const char kExtension1[] = "extension 1"; |
316 const char kExtension2[] = "extension 2"; | 316 const char kExtension2[] = "extension 2"; |
317 { | 317 { |
318 // The order should start as 0, 1, 2. | 318 // The order should start as 0, 1, 2. |
319 const char* expected_names[] = { kExtension0, kExtension1, kExtension2 }; | 319 const char* expected_names[] = { kExtension0, kExtension1, kExtension2 }; |
320 EXPECT_TRUE(VerifyToolbarOrder(expected_names, 3u, 3u)); | 320 EXPECT_TRUE(VerifyToolbarOrder(expected_names, 3u, 3u)); |
321 } | 321 } |
322 | 322 |
323 extensions::ExtensionIdList new_order; | 323 std::vector<std::string> new_order; |
324 new_order.push_back(toolbar_actions_bar()->toolbar_actions_unordered()[1]-> | 324 new_order.push_back(toolbar_actions_bar()->toolbar_actions_unordered()[1]-> |
325 GetId()); | 325 GetId()); |
326 new_order.push_back(toolbar_actions_bar()->toolbar_actions_unordered()[2]-> | 326 new_order.push_back(toolbar_actions_bar()->toolbar_actions_unordered()[2]-> |
327 GetId()); | 327 GetId()); |
328 extensions::ExtensionPrefs::Get(profile())->SetToolbarOrder(new_order); | 328 extensions::ExtensionPrefs::Get(profile())->SetToolbarOrder(new_order); |
329 | 329 |
330 { | 330 { |
331 // The order should now reflect the prefs, and be 1, 2, 0. | 331 // The order should now reflect the prefs, and be 1, 2, 0. |
332 const char* expected_names[] = { kExtension1, kExtension2, kExtension0 }; | 332 const char* expected_names[] = { kExtension1, kExtension2, kExtension0 }; |
333 EXPECT_TRUE(VerifyToolbarOrder(expected_names, 3u, 3u)); | 333 EXPECT_TRUE(VerifyToolbarOrder(expected_names, 3u, 3u)); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 EXPECT_EQ(gfx::Rect(kSpacing, kIconHeight, kIconWidth, kIconHeight), | 441 EXPECT_EQ(gfx::Rect(kSpacing, kIconHeight, kIconWidth, kIconHeight), |
442 overflow_bar()->GetFrameForIndex(6)); | 442 overflow_bar()->GetFrameForIndex(6)); |
443 | 443 |
444 // Check with > 2 rows. | 444 // Check with > 2 rows. |
445 toolbar_model()->SetVisibleIconCount(0); | 445 toolbar_model()->SetVisibleIconCount(0); |
446 EXPECT_EQ(gfx::Rect(kSpacing, 0, kIconWidth, kIconHeight), | 446 EXPECT_EQ(gfx::Rect(kSpacing, 0, kIconWidth, kIconHeight), |
447 overflow_bar()->GetFrameForIndex(0)); | 447 overflow_bar()->GetFrameForIndex(0)); |
448 EXPECT_EQ(gfx::Rect(kSpacing, kIconHeight * 2, kIconWidth, kIconHeight), | 448 EXPECT_EQ(gfx::Rect(kSpacing, kIconHeight * 2, kIconWidth, kIconHeight), |
449 overflow_bar()->GetFrameForIndex(6)); | 449 overflow_bar()->GetFrameForIndex(6)); |
450 } | 450 } |
OLD | NEW |