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

Unified Diff: net/android/http_auth_negotiate_android_unittest.cc

Issue 1128043007: Support Kerberos on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle review comments Created 5 years, 6 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
Index: net/android/http_auth_negotiate_android_unittest.cc
diff --git a/net/android/http_auth_negotiate_android_unittest.cc b/net/android/http_auth_negotiate_android_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1dc5f4be8f398746c8185396e1cfc5c33b542ff1
--- /dev/null
+++ b/net/android/http_auth_negotiate_android_unittest.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/run_loop.h"
+#include "base/test/test_ui_thread_android.h"
+#include "net/android/http_auth_negotiate_android.h"
+#include "net/base/net_errors.h"
+#include "net/http/http_auth_challenge_tokenizer.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace net {
+namespace android {
+
+namespace {
+
+void DummyCallback(base::Closure closure, int /*result*/) {
+ closure.Run();
+}
+
+} // namespace
+
+TEST(AndroidAuthNegotiateTest, GenerateAuthToken) {
+ HttpAuthNegotiateAndroid auth("org.chromium.test.DummySpnegoAuthenticator");
+ EXPECT_TRUE(auth.Init());
+
+ base::StartTestUiThreadLooper();
+
+ std::string auth_token;
Ryan Sleevi 2015/06/16 01:07:46 API DANGER: This sort of highlights the danger in
aberent 2015/06/19 15:06:24 I agree that the std::string* parameter is horribl
+
+ base::RunLoop run_loop;
+ EXPECT_EQ(ERR_IO_PENDING,
+ auth.GenerateAuthToken(
+ nullptr, "Dummy", &auth_token,
+ base::Bind(&DummyCallback, run_loop.QuitClosure())));
+
+ run_loop.Run();
+
+ EXPECT_EQ("Negotiate DummyToken", auth_token);
Ryan Sleevi 2015/06/16 01:07:46 It'd be much better to use a net::TestCompletionCa
aberent 2015/06/19 15:06:24 Done.
+}
+
+} // namespace android
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698