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

Side by Side Diff: remoting/base/auth_token_util_unittest.cc

Issue 7008003: Wire in OAuth2 support into non-sandboxed connections in libjingle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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
(Empty)
1 // Use of this source code is governed by a BSD-style license that can be
Wez 2011/05/25 03:57:46 Missing Copyright line.
awong 2011/05/25 16:56:56 Done.
2 // found in the LICENSE file.
3
4 #include "remoting/base/auth_token_util.h"
5 #include "remoting/base/constants.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 namespace remoting {
9 namespace {
10
11 TEST(AuthTokenUtilTest, ParseAuthTokenWithService) {
12 std::string auth_token;
13 std::string auth_service;
14
15 ParseAuthTokenWithService("service:token", &auth_token, &auth_service);
16 EXPECT_EQ("token", auth_token);
17 EXPECT_EQ("service", auth_service);
18
19 // Check for legacy support.
20 ParseAuthTokenWithService("token2", &auth_token, &auth_service);
21 EXPECT_EQ("token2", auth_token);
22 EXPECT_EQ(kChromotingTokenDefaultServiceName, auth_service);
23
24 ParseAuthTokenWithService("just_service:", &auth_token, &auth_service);
25 EXPECT_EQ("", auth_token);
26 EXPECT_EQ("just_service", auth_service);
27
28 ParseAuthTokenWithService("yay:token:has:colons", &auth_token, &auth_service);
29 EXPECT_EQ("token:has:colons", auth_token);
30 EXPECT_EQ("yay", auth_service);
31 }
32
33 } // namespace
34
35 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698