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 ActionIdList 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE); | 376 ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE); |
377 EXPECT_FALSE( | 377 EXPECT_FALSE( |
378 ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile( | 378 ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile( |
379 profile())); | 379 profile())); |
380 base::Time one_week_ago = base::Time::Now() - base::TimeDelta::FromDays(7); | 380 base::Time one_week_ago = base::Time::Now() - base::TimeDelta::FromDays(7); |
381 prefs->SetInt64(prefs::kToolbarIconSurfacingBubbleLastShowTime, | 381 prefs->SetInt64(prefs::kToolbarIconSurfacingBubbleLastShowTime, |
382 one_week_ago.ToInternalValue()); | 382 one_week_ago.ToInternalValue()); |
383 EXPECT_TRUE( | 383 EXPECT_TRUE( |
384 prefs->GetBoolean(prefs::kToolbarIconSurfacingBubbleAcknowledged)); | 384 prefs->GetBoolean(prefs::kToolbarIconSurfacingBubbleAcknowledged)); |
385 } | 385 } |
OLD | NEW |