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

Unified Diff: remoting/webapp/crd/js/me2me_telemetry_integration_test.js

Issue 1397463003: Report the Auth method for me2me connections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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: remoting/webapp/crd/js/me2me_telemetry_integration_test.js
diff --git a/remoting/webapp/crd/js/me2me_telemetry_integration_test.js b/remoting/webapp/crd/js/me2me_telemetry_integration_test.js
index b7d36cfc40707541f9f6044986a181185f495556..f7d34ee41c35e8c4a38b434922344558c68aad10 100644
--- a/remoting/webapp/crd/js/me2me_telemetry_integration_test.js
+++ b/remoting/webapp/crd/js/me2me_telemetry_integration_test.js
@@ -284,7 +284,7 @@ QUnit.test('HOST_OFFLINE - JID refresh succeeded', function() {
remoting.ClientSession.ConnectionError.HOST_IS_OFFLINE);
} else if (count == 2) {
plugin.mock$useDefaultBehavior(
- remoting.MockClientPlugin.AuthMethod.PIN);
+ remoting.ChromotingEvent.AuthMethod.PIN);
}
}
@@ -406,4 +406,76 @@ QUnit.test('Connection dropped - Auto Reconnect', function() {
return testDriver.startTest();
});
+
+/**
+ * @param {remoting.Me2MeTestDriver} testDriver
+ * @param {remoting.ChromotingEvent.AuthMethod} authMethod
+ * @return {Promise}
+ */
+function createAuthMethodTest(testDriver, authMethod) {
+ var ChromotingEvent = remoting.ChromotingEvent;
+ expectSequence(
+ testDriver,
+ {
+ session_entry_point: ChromotingEvent.SessionEntryPoint.CONNECT_BUTTON,
+ role: ChromotingEvent.Role.CLIENT,
+ mode: ChromotingEvent.Mode.ME2ME,
+ },
+ [
+ ChromotingEvent.SessionState.STARTED,
+ ChromotingEvent.SessionState.SIGNALING,
+ ChromotingEvent.SessionState.CREATING_PLUGIN,
+ ChromotingEvent.SessionState.CONNECTING,
+ ]);
+ expectSequence(
+ testDriver,
+ {
+ session_entry_point: ChromotingEvent.SessionEntryPoint.CONNECT_BUTTON,
+ role: ChromotingEvent.Role.CLIENT,
+ mode: ChromotingEvent.Mode.ME2ME,
+ auth_method: authMethod
+ },
+ [
+ ChromotingEvent.SessionState.AUTHENTICATED,
+ ChromotingEvent.SessionState.CONNECTED,
+ ChromotingEvent.SessionState.CLOSED
+ ]);
+
+ /**
+ * @param {remoting.MockClientPlugin} plugin
+ * @param {remoting.ClientSession.State} state
+ */
+ function onStatusChanged(plugin, state) {
+ if (state == remoting.ClientSession.State.CONNECTED) {
+ testDriver.me2meActivity().stop();
+ testDriver.endTest();
+ }
+ }
+ function onPluginCreated(/** remoting.MockClientPlugin */ plugin) {
+ plugin.mock$useDefaultBehavior(authMethod);
+ }
+
+ testDriver.mockConnection().pluginFactory().mock$setPluginCreated(
+ onPluginCreated);
+ testDriver.mockConnection().pluginFactory().mock$setPluginStatusChanged(
+ onStatusChanged);
+
+ return testDriver.startTest();
+}
+
+QUnit.test('Auth method - THIRD_PARTY (connected)', function() {
+ return createAuthMethodTest(testDriver,
+ remoting.ChromotingEvent.AuthMethod.THIRD_PARTY);
+});
+
+QUnit.test('Auth method - PINLESS (connected)', function() {
+ return createAuthMethodTest(testDriver,
+ remoting.ChromotingEvent.AuthMethod.PINLESS);
+});
+
+QUnit.test('Auth method - PIN (connected)', function() {
+ return createAuthMethodTest(testDriver,
+ remoting.ChromotingEvent.AuthMethod.PIN);
+});
+
Jamie 2015/10/09 01:17:21 Add a test that the auth method is set for failed
kelvinp 2015/10/09 18:00:34 Done.
})();

Powered by Google App Engine
This is Rietveld 408576698