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 "base/files/file_util.h" | 5 #include "base/files/file_util.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 10 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 EXPECT_TRUE(ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile( | 1222 EXPECT_TRUE(ExtensionToolbarIconSurfacingBubbleDelegate::ShouldShowForProfile( |
1223 profile())); | 1223 profile())); |
1224 EXPECT_TRUE(toolbar_model->is_highlighting()); | 1224 EXPECT_TRUE(toolbar_model->is_highlighting()); |
1225 EXPECT_EQ(ToolbarActionsModel::HIGHLIGHT_INFO, | 1225 EXPECT_EQ(ToolbarActionsModel::HIGHLIGHT_INFO, |
1226 toolbar_model->highlight_type()); | 1226 toolbar_model->highlight_type()); |
1227 EXPECT_EQ(3u, toolbar_model->visible_icon_count()); | 1227 EXPECT_EQ(3u, toolbar_model->visible_icon_count()); |
1228 EXPECT_EQ(3u, toolbar_model->toolbar_items().size()); | 1228 EXPECT_EQ(3u, toolbar_model->toolbar_items().size()); |
1229 | 1229 |
1230 scoped_ptr<ToolbarActionsBarBubbleDelegate> bubble( | 1230 scoped_ptr<ToolbarActionsBarBubbleDelegate> bubble( |
1231 new ExtensionToolbarIconSurfacingBubbleDelegate(profile())); | 1231 new ExtensionToolbarIconSurfacingBubbleDelegate(profile())); |
1232 bubble->OnBubbleClosed( | 1232 bubble->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_DISMISS); |
1233 ToolbarActionsBarBubbleDelegate::CLOSE_DISMISS_USER_ACTION); | |
1234 | 1233 |
1235 EXPECT_FALSE(toolbar_model->is_highlighting()); | 1234 EXPECT_FALSE(toolbar_model->is_highlighting()); |
1236 EXPECT_EQ(ToolbarActionsModel::HIGHLIGHT_NONE, | 1235 EXPECT_EQ(ToolbarActionsModel::HIGHLIGHT_NONE, |
1237 toolbar_model->highlight_type()); | 1236 toolbar_model->highlight_type()); |
1238 } | 1237 } |
1239 | 1238 |
1240 // Test various different reorderings, removals, and reinsertions of the | 1239 // Test various different reorderings, removals, and reinsertions of the |
1241 // toolbar with component actions. | 1240 // toolbar with component actions. |
1242 TEST_F(ToolbarActionsModelUnitTest, | 1241 TEST_F(ToolbarActionsModelUnitTest, |
1243 ActionsToolbarReorderAndReinsertWithSwitchAndComponentActions) { | 1242 ActionsToolbarReorderAndReinsertWithSwitchAndComponentActions) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 EXPECT_EQ(component_action_id(), GetActionIdAtIndex(0u)); | 1334 EXPECT_EQ(component_action_id(), GetActionIdAtIndex(0u)); |
1336 | 1335 |
1337 // Load extension C again. | 1336 // Load extension C again. |
1338 ASSERT_TRUE(AddExtension(browser_action_c())); | 1337 ASSERT_TRUE(AddExtension(browser_action_c())); |
1339 EXPECT_EQ(4u, observer()->inserted_count()); | 1338 EXPECT_EQ(4u, observer()->inserted_count()); |
1340 EXPECT_EQ(2u, num_toolbar_items()); | 1339 EXPECT_EQ(2u, num_toolbar_items()); |
1341 // Make sure it gets its old spot in the list (at the beginning). | 1340 // Make sure it gets its old spot in the list (at the beginning). |
1342 EXPECT_EQ(browser_action_c()->id(), GetActionIdAtIndex(0u)); | 1341 EXPECT_EQ(browser_action_c()->id(), GetActionIdAtIndex(0u)); |
1343 EXPECT_EQ(component_action_id(), GetActionIdAtIndex(1u)); | 1342 EXPECT_EQ(component_action_id(), GetActionIdAtIndex(1u)); |
1344 } | 1343 } |
OLD | NEW |