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

Unified Diff: remoting/base/oauth_helper_unittest.cc

Issue 2661153003: Moving oauth code from host to base to allow code sharing between host and client. (Closed)
Patch Set: Merge branch 'master' into auth_token Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/oauth_helper.cc ('k') | remoting/base/oauth_token_getter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/oauth_helper_unittest.cc
diff --git a/remoting/host/setup/oauth_helper_unittest.cc b/remoting/base/oauth_helper_unittest.cc
similarity index 78%
rename from remoting/host/setup/oauth_helper_unittest.cc
rename to remoting/base/oauth_helper_unittest.cc
index f5e36164433182767b162c1c94b24a1b797e521d..71ea3a7a314c9ae61c479adce5bfb96ac4546b82 100644
--- a/remoting/host/setup/oauth_helper_unittest.cc
+++ b/remoting/base/oauth_helper_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/setup/oauth_helper.h"
+#include "remoting/base/oauth_helper.h"
#include <stddef.h>
@@ -10,14 +10,15 @@
namespace {
-std::string Replace(const std::string& s, const std::string& old_substr,
+std::string Replace(const std::string& s,
+ const std::string& old_substr,
const std::string& new_substr) {
size_t pos = s.find(old_substr);
if (pos == std::string::npos) {
return s;
}
return s.substr(0, pos) + new_substr +
- s.substr(pos + old_substr.length(), std::string::npos);
+ s.substr(pos + old_substr.length(), std::string::npos);
}
std::string GetTestRedirectUrl() {
@@ -37,8 +38,8 @@ TEST(OauthHelperTest, TestVeryShort) {
}
TEST(OauthHelperTest, TestEmptyQuery) {
- ASSERT_EQ("", GetOauthCodeInUrl(GetTestRedirectUrl() + "?",
- GetTestRedirectUrl()));
+ ASSERT_EQ(
+ "", GetOauthCodeInUrl(GetTestRedirectUrl() + "?", GetTestRedirectUrl()));
}
TEST(OauthHelperTest, TestNoQueryValue) {
@@ -57,9 +58,9 @@ TEST(OauthHelperTest, TestCode) {
}
TEST(OauthHelperTest, TestCodeInLongQuery) {
- ASSERT_EQ("Dummy", GetOauthCodeInUrl(GetTestRedirectUrl() +
- "?x=1&code=Dummy&y=2",
- GetTestRedirectUrl()));
+ ASSERT_EQ("Dummy",
+ GetOauthCodeInUrl(GetTestRedirectUrl() + "?x=1&code=Dummy&y=2",
+ GetTestRedirectUrl()));
}
TEST(OauthHelperTest, TestBadScheme) {
« no previous file with comments | « remoting/base/oauth_helper.cc ('k') | remoting/base/oauth_token_getter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698