OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/signin/chrome_signin_client.h" | 5 #include "chrome/browser/signin/chrome_signin_client.h" |
6 #include "chrome/browser/signin/chrome_signin_client_factory.h" | 6 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
7 #include "chrome/browser/signin/signin_manager_factory.h" | 7 #include "chrome/browser/signin/signin_manager_factory.h" |
8 #include "chrome/test/base/testing_browser_process.h" | 8 #include "chrome/test/base/testing_browser_process.h" |
9 #include "chrome/test/base/testing_profile.h" | 9 #include "chrome/test/base/testing_profile.h" |
10 #include "chrome/test/base/testing_profile_manager.h" | 10 #include "chrome/test/base/testing_profile_manager.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 SigninClient* signin_client = | 67 SigninClient* signin_client = |
68 ChromeSigninClientFactory::GetForProfile(profile_); | 68 ChromeSigninClientFactory::GetForProfile(profile_); |
69 ASSERT_TRUE(signin_client); | 69 ASSERT_TRUE(signin_client); |
70 signin_client->SetSigninProcess(signin_process.GetID()); | 70 signin_client->SetSigninProcess(signin_process.GetID()); |
71 | 71 |
72 scoped_refptr<const Extension> extension(CreateTestExtension("a")); | 72 scoped_refptr<const Extension> extension(CreateTestExtension("a")); |
73 std::string error; | 73 std::string error; |
74 | 74 |
75 // The same call should succeed with a normal process, but fail with a signin | 75 // The same call should succeed with a normal process, but fail with a signin |
76 // process. | 76 // process. |
77 const PermissionsData* permissions_data = | 77 const PermissionsData* permissions_data = extension->permissions_data(); |
78 PermissionsData::ForExtension(extension); | |
79 EXPECT_TRUE(permissions_data->CanExecuteScriptOnPage(extension, | 78 EXPECT_TRUE(permissions_data->CanExecuteScriptOnPage(extension, |
80 kSigninUrl, | 79 kSigninUrl, |
81 kSigninUrl, | 80 kSigninUrl, |
82 -1, | 81 -1, |
83 NULL, | 82 NULL, |
84 normal_process.GetID(), | 83 normal_process.GetID(), |
85 &error)) | 84 &error)) |
86 << error; | 85 << error; |
87 EXPECT_FALSE(permissions_data->CanExecuteScriptOnPage(extension, | 86 EXPECT_FALSE(permissions_data->CanExecuteScriptOnPage(extension, |
88 kSigninUrl, | 87 kSigninUrl, |
89 kSigninUrl, | 88 kSigninUrl, |
90 -1, | 89 -1, |
91 NULL, | 90 NULL, |
92 signin_process.GetID(), | 91 signin_process.GetID(), |
93 &error)) | 92 &error)) |
94 << error; | 93 << error; |
95 } | 94 } |
96 #endif | 95 #endif |
97 | 96 |
98 } // namespace extensions | 97 } // namespace extensions |
OLD | NEW |