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

Side by Side Diff: extensions/shell/browser/api/identity/identity_api_unittest.cc

Issue 804673002: app_shell: Extend identity API stub (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unlimited-storage
Patch Set: (identity-stub) rebase Created 6 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/shell/browser/api/identity/identity_api.h" 5 #include "extensions/shell/browser/api/identity/identity_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 // Function succeeds and returns a token (for its callback). 78 // Function succeeds and returns a token (for its callback).
79 scoped_ptr<base::Value> result = 79 scoped_ptr<base::Value> result =
80 RunFunctionAndReturnValue(new IdentityGetAuthTokenFunction, "[{}]"); 80 RunFunctionAndReturnValue(new IdentityGetAuthTokenFunction, "[{}]");
81 ASSERT_TRUE(result.get()); 81 ASSERT_TRUE(result.get());
82 std::string value; 82 std::string value;
83 result->GetAsString(&value); 83 result->GetAsString(&value);
84 EXPECT_EQ("token123", value); 84 EXPECT_EQ("token123", value);
85 } 85 }
86 86
87 // Verifies that the removeCachedAuthToken function exists and can be called
88 // without crashing.
89 TEST_F(IdentityApiTest, RemoveCachedAuthToken) {
90 MockShellOAuth2TokenService token_service;
91
92 // Function succeeds and returns nothing (for its callback).
93 scoped_ptr<base::Value> result = RunFunctionAndReturnValue(
94 new IdentityRemoveCachedAuthTokenFunction, "[{}]");
95 EXPECT_FALSE(result.get());
96 }
97
87 } // namespace shell 98 } // namespace shell
88 } // namespace extensions 99 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/browser/api/identity/identity_api.cc ('k') | extensions/shell/common/api/identity.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698