Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2613713005: Make ToolbarActionsModel own ComponentToolbarActionsFactory (Closed)
Patch Set: Address Devlin and Mike's comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 #include "chrome/browser/ui/extensions/application_launch.h" 221 #include "chrome/browser/ui/extensions/application_launch.h"
222 #include "extensions/browser/app_window/app_window.h" 222 #include "extensions/browser/app_window/app_window.h"
223 #include "extensions/browser/app_window/app_window_registry.h" 223 #include "extensions/browser/app_window/app_window_registry.h"
224 #include "extensions/browser/app_window/native_app_window.h" 224 #include "extensions/browser/app_window/native_app_window.h"
225 #include "ui/base/window_open_disposition.h" 225 #include "ui/base/window_open_disposition.h"
226 #endif 226 #endif
227 227
228 #if defined(ENABLE_MEDIA_ROUTER) && !defined(OS_ANDROID) 228 #if defined(ENABLE_MEDIA_ROUTER) && !defined(OS_ANDROID)
229 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" 229 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h"
230 #include "chrome/browser/ui/toolbar/media_router_action_controller.h" 230 #include "chrome/browser/ui/toolbar/media_router_action_controller.h"
231 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h"
231 #endif // defined(ENABLE_MEDIA_ROUTER) && !defined(OS_ANDROID) 232 #endif // defined(ENABLE_MEDIA_ROUTER) && !defined(OS_ANDROID)
232 233
233 using content::BrowserThread; 234 using content::BrowserThread;
234 using net::URLRequestMockHTTPJob; 235 using net::URLRequestMockHTTPJob;
235 using testing::Mock; 236 using testing::Mock;
236 using testing::Return; 237 using testing::Return;
237 using testing::_; 238 using testing::_;
238 239
239 namespace policy { 240 namespace policy {
240 241
(...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after
3604 PolicyMap policies; 3605 PolicyMap policies;
3605 policies.Set(key::kShowCastIconInToolbar, POLICY_LEVEL_MANDATORY, 3606 policies.Set(key::kShowCastIconInToolbar, POLICY_LEVEL_MANDATORY,
3606 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, 3607 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
3607 base::MakeUnique<base::FundamentalValue>(enable), nullptr); 3608 base::MakeUnique<base::FundamentalValue>(enable), nullptr);
3608 provider_.UpdateChromePolicy(policies); 3609 provider_.UpdateChromePolicy(policies);
3609 } 3610 }
3610 3611
3611 protected: 3612 protected:
3612 bool HasMediaRouterActionAtInit() const { 3613 bool HasMediaRouterActionAtInit() const {
3613 const std::set<std::string>& component_ids = 3614 const std::set<std::string>& component_ids =
3614 ComponentToolbarActionsFactory::GetInstance()->GetInitialComponentIds( 3615 ToolbarActionsModel::Get(browser()->profile())
3615 browser()->profile()); 3616 ->component_actions_factory()
3617 ->GetInitialComponentIds();
3618
3616 return base::ContainsKey( 3619 return base::ContainsKey(
3617 component_ids, ComponentToolbarActionsFactory::kMediaRouterActionId); 3620 component_ids, ComponentToolbarActionsFactory::kMediaRouterActionId);
3618 } 3621 }
3619 }; 3622 };
3620 3623
3621 using MediaRouterActionEnabledPolicyTest = MediaRouterActionPolicyTest<true>; 3624 using MediaRouterActionEnabledPolicyTest = MediaRouterActionPolicyTest<true>;
3622 using MediaRouterActionDisabledPolicyTest = MediaRouterActionPolicyTest<false>; 3625 using MediaRouterActionDisabledPolicyTest = MediaRouterActionPolicyTest<false>;
3623 3626
3624 IN_PROC_BROWSER_TEST_F(MediaRouterActionEnabledPolicyTest, 3627 IN_PROC_BROWSER_TEST_F(MediaRouterActionEnabledPolicyTest,
3625 MediaRouterActionEnabled) { 3628 MediaRouterActionEnabled) {
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
4393 4396
4394 SetEmptyPolicy(); 4397 SetEmptyPolicy();
4395 // Policy not set. 4398 // Policy not set.
4396 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4399 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4397 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4400 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4398 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4401 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4399 } 4402 }
4400 #endif // defined(OS_CHROMEOS) 4403 #endif // defined(OS_CHROMEOS)
4401 4404
4402 } // namespace policy 4405 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698