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

Side by Side Diff: chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api_unittest.cc

Issue 1549233002: Convert Pass()→std::move() in //chrome/browser/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 11 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 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/extensions/api/cryptotoken_private/cryptotoken_private_ api.h" 5 #include "chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_ api.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility>
10 #include <vector> 11 #include <vector>
11 12
12 #include "chrome/browser/extensions/extension_api_unittest.h" 13 #include "chrome/browser/extensions/extension_api_unittest.h"
13 #include "chrome/browser/extensions/extension_function_test_utils.h" 14 #include "chrome/browser/extensions/extension_function_test_utils.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
16 namespace extensions { 17 namespace extensions {
17 18
18 namespace { 19 namespace {
19 20
(...skipping 29 matching lines...) Expand all
49 const std::string& appId) { 50 const std::string& appId) {
50 scoped_refptr<api::CryptotokenPrivateCanOriginAssertAppIdFunction> function( 51 scoped_refptr<api::CryptotokenPrivateCanOriginAssertAppIdFunction> function(
51 new api::CryptotokenPrivateCanOriginAssertAppIdFunction()); 52 new api::CryptotokenPrivateCanOriginAssertAppIdFunction());
52 function->set_has_callback(true); 53 function->set_has_callback(true);
53 54
54 scoped_ptr<base::ListValue> args(new base::ListValue); 55 scoped_ptr<base::ListValue> args(new base::ListValue);
55 args->AppendString(origin); 56 args->AppendString(origin);
56 args->AppendString(appId); 57 args->AppendString(appId);
57 58
58 extension_function_test_utils::RunFunction( 59 extension_function_test_utils::RunFunction(
59 function.get(), 60 function.get(), std::move(args), browser(),
60 args.Pass(),
61 browser(),
62 extension_function_test_utils::NONE); 61 extension_function_test_utils::NONE);
63 62
64 bool result; 63 bool result;
65 GetSingleBooleanResult(function.get(), &result); 64 GetSingleBooleanResult(function.get(), &result);
66 return result; 65 return result;
67 } 66 }
68 }; 67 };
69 68
70 TEST_F(CryptoTokenPrivateApiTest, CanOriginAssertAppId) { 69 TEST_F(CryptoTokenPrivateApiTest, CanOriginAssertAppId) {
71 std::string origin1("https://www.example.com"); 70 std::string origin1("https://www.example.com");
(...skipping 15 matching lines...) Expand all
87 std::string gstatic_appid("https://www.gstatic.com/securitykey/origins.json"); 86 std::string gstatic_appid("https://www.gstatic.com/securitykey/origins.json");
88 EXPECT_TRUE(GetCanOriginAssertAppIdResult(google_origin, gstatic_appid)); 87 EXPECT_TRUE(GetCanOriginAssertAppIdResult(google_origin, gstatic_appid));
89 // Not all gstatic urls are allowed, just those specifically whitelisted. 88 // Not all gstatic urls are allowed, just those specifically whitelisted.
90 std::string gstatic_otherurl("https://www.gstatic.com/foobar"); 89 std::string gstatic_otherurl("https://www.gstatic.com/foobar");
91 EXPECT_FALSE(GetCanOriginAssertAppIdResult(google_origin, gstatic_otherurl)); 90 EXPECT_FALSE(GetCanOriginAssertAppIdResult(google_origin, gstatic_otherurl));
92 } 91 }
93 92
94 } // namespace 93 } // namespace
95 94
96 } // namespace extensions 95 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698