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

Unified Diff: service/user/testable.go

Issue 1522783002: Add User Testing interface to impl/memory. (Closed) Base URL: https://github.com/luci/gae.git@logging_service
Patch Set: rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « service/user/interface.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/user/testable.go
diff --git a/service/user/testable.go b/service/user/testable.go
new file mode 100644
index 0000000000000000000000000000000000000000..749b60ed473c079b66092ad88aa0481bfe616e96
--- /dev/null
+++ b/service/user/testable.go
@@ -0,0 +1,20 @@
+// Copyright 2015 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.
+
+package user
+
+// Testable is the interface that test implimentations will provide.
+type Testable interface {
+ // SetUser sets the user to a pre-populated User object.
+ SetUser(*User)
+
+ // Login will generate and set a new User object with values derived from
+ // email clientID, and admin values. If clientID is provided, the User will
+ // look like they logged in with OAuth. If it's empty, then this will look
+ // like they logged in via the cookie auth method.
+ Login(email, clientID string, admin bool)
+
+ // Equivalent to SetUser(nil), but a bit more obvious to read in the code :).
+ Logout()
+}
« no previous file with comments | « service/user/interface.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698