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

Side by Side Diff: chrome/common/extensions/permissions/permissions_data_unittest.cc

Issue 655063002: Use uint16 for port numbers more pervasively. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert bad change Created 6 years, 1 month 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <vector> 5 #include <vector>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 24 matching lines...) Expand all
35 namespace extensions { 35 namespace extensions {
36 36
37 namespace { 37 namespace {
38 38
39 const char kAllHostsPermission[] = "*://*/*"; 39 const char kAllHostsPermission[] = "*://*/*";
40 40
41 bool CheckSocketPermission( 41 bool CheckSocketPermission(
42 scoped_refptr<Extension> extension, 42 scoped_refptr<Extension> extension,
43 SocketPermissionRequest::OperationType type, 43 SocketPermissionRequest::OperationType type,
44 const char* host, 44 const char* host,
45 int port) { 45 uint16 port) {
46 SocketPermission::CheckParam param(type, host, port); 46 SocketPermission::CheckParam param(type, host, port);
47 return extension->permissions_data()->CheckAPIPermissionWithParam( 47 return extension->permissions_data()->CheckAPIPermissionWithParam(
48 APIPermission::kSocket, &param); 48 APIPermission::kSocket, &param);
49 } 49 }
50 50
51 // Creates and returns an extension with the given |id|, |host_permissions|, and 51 // Creates and returns an extension with the given |id|, |host_permissions|, and
52 // manifest |location|. 52 // manifest |location|.
53 scoped_refptr<const Extension> GetExtensionWithHostPermission( 53 scoped_refptr<const Extension> GetExtensionWithHostPermission(
54 const std::string& id, 54 const std::string& id,
55 const std::string& host_permissions, 55 const std::string& host_permissions,
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 744
745 permissions_data->ClearTabSpecificPermissions(1); 745 permissions_data->ClearTabSpecificPermissions(1);
746 EXPECT_FALSE(permissions_data->GetTabSpecificPermissionsForTesting(1).get()); 746 EXPECT_FALSE(permissions_data->GetTabSpecificPermissionsForTesting(1).get());
747 747
748 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 0)); 748 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 0));
749 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 1)); 749 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 1));
750 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 2)); 750 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 2));
751 } 751 }
752 752
753 } // namespace extensions 753 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/profiles/host_zoom_map_browsertest.cc ('k') | chrome/test/base/testing_browser_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698