| 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/browser_actions_bar_browsertest.h" | 5 #include "chrome/browser/ui/toolbar/browser_actions_bar_browsertest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 : toolbar_model_(nullptr) { | 63 : toolbar_model_(nullptr) { |
| 64 } | 64 } |
| 65 | 65 |
| 66 BrowserActionsBarBrowserTest::~BrowserActionsBarBrowserTest() { | 66 BrowserActionsBarBrowserTest::~BrowserActionsBarBrowserTest() { |
| 67 } | 67 } |
| 68 | 68 |
| 69 void BrowserActionsBarBrowserTest::SetUpCommandLine( | 69 void BrowserActionsBarBrowserTest::SetUpCommandLine( |
| 70 base::CommandLine* command_line) { | 70 base::CommandLine* command_line) { |
| 71 ExtensionBrowserTest::SetUpCommandLine(command_line); | 71 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 72 ToolbarActionsBar::disable_animations_for_testing_ = true; | 72 ToolbarActionsBar::disable_animations_for_testing_ = true; |
| 73 // We need to disable Media Router since having Media Router enabled will | |
| 74 // result in auto-enabling the redesign and breaking the test. | |
| 75 override_media_router_.reset(new extensions::FeatureSwitch::ScopedOverride( | |
| 76 extensions::FeatureSwitch::media_router(), false)); | |
| 77 // These tests are deliberately testing behavior without the redesign. | 73 // These tests are deliberately testing behavior without the redesign. |
| 78 // Forcefully disable it. | 74 // Forcefully disable it. |
| 79 override_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride( | 75 override_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride( |
| 80 extensions::FeatureSwitch::extension_action_redesign(), true)); | 76 extensions::FeatureSwitch::extension_action_redesign(), true)); |
| 81 } | 77 } |
| 82 | 78 |
| 83 void BrowserActionsBarBrowserTest::SetUpOnMainThread() { | 79 void BrowserActionsBarBrowserTest::SetUpOnMainThread() { |
| 84 ExtensionBrowserTest::SetUpOnMainThread(); | 80 ExtensionBrowserTest::SetUpOnMainThread(); |
| 85 browser_actions_bar_.reset(new BrowserActionTestUtil(browser())); | 81 browser_actions_bar_.reset(new BrowserActionTestUtil(browser())); |
| 86 toolbar_model_ = ToolbarActionsModel::Get(profile()); | 82 toolbar_model_ = ToolbarActionsModel::Get(profile()); |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 EXPECT_EQ(2, browser_actions_bar()->VisibleBrowserActions()); | 629 EXPECT_EQ(2, browser_actions_bar()->VisibleBrowserActions()); |
| 634 ASSERT_TRUE(toolbar_actions_bar->popped_out_action()); | 630 ASSERT_TRUE(toolbar_actions_bar->popped_out_action()); |
| 635 EXPECT_EQ(extension3->id(), | 631 EXPECT_EQ(extension3->id(), |
| 636 toolbar_actions_bar->popped_out_action()->GetId()); | 632 toolbar_actions_bar->popped_out_action()->GetId()); |
| 637 extension_service()->UnloadExtension( | 633 extension_service()->UnloadExtension( |
| 638 extension3->id(), extensions::UnloadedExtensionInfo::REASON_DISABLE); | 634 extension3->id(), extensions::UnloadedExtensionInfo::REASON_DISABLE); |
| 639 EXPECT_EQ(1, browser_actions_bar()->VisibleBrowserActions()); | 635 EXPECT_EQ(1, browser_actions_bar()->VisibleBrowserActions()); |
| 640 EXPECT_EQ(1, browser_actions_bar()->NumberOfBrowserActions()); | 636 EXPECT_EQ(1, browser_actions_bar()->NumberOfBrowserActions()); |
| 641 EXPECT_FALSE(toolbar_actions_bar->popped_out_action()); | 637 EXPECT_FALSE(toolbar_actions_bar->popped_out_action()); |
| 642 } | 638 } |
| OLD | NEW |