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

Side by Side Diff: chrome/browser/extensions/browser_permissions_policy_delegate_unittest.cc

Issue 309533007: Refactor PermissionsData pt1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
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
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 EXPECT_TRUE(PermissionsData::CanExecuteScriptOnPage(extension.get(), 77 const PermissionsData* permissions_data =
78 kSigninUrl, 78 PermissionsData::ForExtension(extension);
79 kSigninUrl, 79 EXPECT_TRUE(permissions_data->CanExecuteScriptOnPage(extension,
80 -1,
81 NULL,
82 normal_process.GetID(),
83 &error)) << error;
84 EXPECT_FALSE(PermissionsData::CanExecuteScriptOnPage(extension.get(),
85 kSigninUrl, 80 kSigninUrl,
86 kSigninUrl, 81 kSigninUrl,
87 -1, 82 -1,
88 NULL, 83 NULL,
89 signin_process.GetID(), 84 normal_process.GetID(),
90 &error)) << error; 85 &error))
86 << error;
87 EXPECT_FALSE(permissions_data->CanExecuteScriptOnPage(extension,
88 kSigninUrl,
89 kSigninUrl,
90 -1,
91 NULL,
92 signin_process.GetID(),
93 &error))
94 << error;
91 } 95 }
92 #endif 96 #endif
93 97
94 } // namespace extensions 98 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_permissions.cc ('k') | chrome/browser/extensions/bundle_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698