| OLD | NEW |
| 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "chrome/browser/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
| 17 #include "components/prefs/pref_service.h" | 17 #include "components/prefs/pref_service.h" |
| 18 #if defined(OS_CHROMEOS) | 18 #if defined(OS_CHROMEOS) |
| 19 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" | 19 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" |
| 20 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 20 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 21 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 21 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 22 #include "chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h" | 22 #include "chrome/browser/chromeos/settings/stub_install_attributes.h" |
| 23 #include "extensions/common/extension_builder.h" | 23 #include "extensions/common/extension_builder.h" |
| 24 #endif | 24 #endif |
| 25 #include "chrome/browser/extensions/api/identity/identity_api.h" | 25 #include "chrome/browser/extensions/api/identity/identity_api.h" |
| 26 #include "chrome/browser/extensions/component_loader.h" | 26 #include "chrome/browser/extensions/component_loader.h" |
| 27 #include "chrome/browser/extensions/extension_apitest.h" | 27 #include "chrome/browser/extensions/extension_apitest.h" |
| 28 #include "chrome/browser/extensions/extension_browsertest.h" | 28 #include "chrome/browser/extensions/extension_browsertest.h" |
| 29 #include "chrome/browser/extensions/extension_function_test_utils.h" | 29 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 30 #include "chrome/browser/extensions/extension_service.h" | 30 #include "chrome/browser/extensions/extension_service.h" |
| 31 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
| 32 #include "chrome/browser/signin/account_tracker_service_factory.h" | 32 #include "chrome/browser/signin/account_tracker_service_factory.h" |
| (...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1588 GetAuthTokenFunctionTest::SetUpInProcessBrowserTestFixture(); | 1588 GetAuthTokenFunctionTest::SetUpInProcessBrowserTestFixture(); |
| 1589 | 1589 |
| 1590 // Set up the user manager to fake a public session. | 1590 // Set up the user manager to fake a public session. |
| 1591 EXPECT_CALL(*user_manager_, IsLoggedInAsKioskApp()) | 1591 EXPECT_CALL(*user_manager_, IsLoggedInAsKioskApp()) |
| 1592 .WillRepeatedly(Return(false)); | 1592 .WillRepeatedly(Return(false)); |
| 1593 EXPECT_CALL(*user_manager_, IsLoggedInAsPublicAccount()) | 1593 EXPECT_CALL(*user_manager_, IsLoggedInAsPublicAccount()) |
| 1594 .WillRepeatedly(Return(true)); | 1594 .WillRepeatedly(Return(true)); |
| 1595 | 1595 |
| 1596 // Set up fake install attributes to make the device appeared as | 1596 // Set up fake install attributes to make the device appeared as |
| 1597 // enterprise-managed. | 1597 // enterprise-managed. |
| 1598 std::unique_ptr<policy::StubEnterpriseInstallAttributes> attributes( | 1598 std::unique_ptr<chromeos::StubInstallAttributes> attributes |
| 1599 new policy::StubEnterpriseInstallAttributes()); | 1599 = base::MakeUnique<chromeos::StubInstallAttributes>(); |
| 1600 attributes->SetDomain("example.com"); | 1600 attributes->SetDomain("example.com"); |
| 1601 attributes->SetRegistrationUser("user@example.com"); | 1601 attributes->SetRegistrationUser("user@example.com"); |
| 1602 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting( | 1602 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting( |
| 1603 attributes.release()); | 1603 attributes.release()); |
| 1604 } | 1604 } |
| 1605 | 1605 |
| 1606 scoped_refptr<Extension> CreateTestExtension(const std::string& id) { | 1606 scoped_refptr<Extension> CreateTestExtension(const std::string& id) { |
| 1607 return ExtensionBuilder() | 1607 return ExtensionBuilder() |
| 1608 .SetManifest( | 1608 .SetManifest( |
| 1609 DictionaryBuilder() | 1609 DictionaryBuilder() |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1854 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), | 1854 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), |
| 1855 url); | 1855 url); |
| 1856 } | 1856 } |
| 1857 | 1857 |
| 1858 } // namespace extensions | 1858 } // namespace extensions |
| 1859 | 1859 |
| 1860 // Tests the chrome.identity API implemented by custom JS bindings . | 1860 // Tests the chrome.identity API implemented by custom JS bindings . |
| 1861 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) { | 1861 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) { |
| 1862 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_; | 1862 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_; |
| 1863 } | 1863 } |
| OLD | NEW |