Skip to content
Snippets Groups Projects
Commit 9a6a6fc8 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

Merge pull request #1190 from mozilla/issue_1188_offline_check

Removing the offline check code that was already disabled.
parents a54cbad3 e2210f44
No related branches found
No related tags found
No related merge requests found
......@@ -67,10 +67,6 @@ BrowserID.Modules.Actions = (function() {
this.renderError(template, info);
},
doOffline: function() {
this.renderError("offline", {});
},
doCancel: function() {
if(onsuccess) onsuccess(null);
},
......
......@@ -16,15 +16,6 @@ BrowserID.Modules.Dialog = (function() {
channel,
sc;
function checkOnline() {
if (false && 'onLine' in navigator && !navigator.onLine) {
this.publish("offline");
return false;
}
return true;
}
function startActions(onsuccess, onerror) {
var actions = BrowserID.Modules.Actions.create();
actions.start({
......@@ -121,35 +112,26 @@ BrowserID.Modules.Dialog = (function() {
var actions = startActions.call(self, success, error);
startStateMachine.call(self, actions);
if(checkOnline.call(self)) {
params = params || {};
params.hostname = user.getHostname();
// XXX Perhaps put this into the state machine.
self.bind(win, "unload", onWindowUnload);
params = params || {};
params.hostname = user.getHostname();
if(hash.indexOf("#CREATE_EMAIL=") === 0) {
var email = hash.replace(/#CREATE_EMAIL=/, "");
params.type = "primary";
params.email = email;
params.add = false;
}
else if(hash.indexOf("#ADD_EMAIL=") === 0) {
var email = hash.replace(/#ADD_EMAIL=/, "");
params.type = "primary";
params.email = email;
params.add = true;
}
/*
if(hash.indexOf("REQUIRED=true") > -1) {
params.requiredEmail = params.email;
}
*/
// XXX Perhaps put this into the state machine.
self.bind(win, "unload", onWindowUnload);
self.publish("start", params);
if(hash.indexOf("#CREATE_EMAIL=") === 0) {
var email = hash.replace(/#CREATE_EMAIL=/, "");
params.type = "primary";
params.email = email;
params.add = false;
}
else if(hash.indexOf("#ADD_EMAIL=") === 0) {
var email = hash.replace(/#ADD_EMAIL=/, "");
params.type = "primary";
params.email = email;
params.add = true;
}
self.publish("start", params);
}
// BEGIN TESTING API
......
......@@ -32,10 +32,6 @@ BrowserID.State = (function() {
},
cancelState = self.popState.bind(self);
subscribe("offline", function(msg, info) {
startState("doOffline");
});
subscribe("start", function(msg, info) {
info = info || {};
......
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<h2 id="offline"><%= gettext('You are offline!') %></h2>
<p>
<%= gettext('We are sorry, but we cannot communicate with BrowserID while you are offline.') %>
</p>
......@@ -78,11 +78,6 @@ BrowserID.Errors = (function(){
title: "Logout Failed"
},
offline: {
title: gettext("You are offline!"),
message: gettext("Unfortunately, BrowserID cannot communicate while offline!")
},
primaryAuthentication: {
title: "Authenticating with Identity Provider",
message: "We had trouble communicating with your email provider, please try again!"
......
......@@ -54,17 +54,6 @@
});
});
asyncTest("doOffline - print offline error screen", function() {
createController({
ready: function() {
controller.doOffline();
ok($("#error .contents").text().length, "contents have been written");
ok($("#error #offline").text().length, "offline error message has been written");
start();
}
});
});
asyncTest("doProvisionPrimaryUser - start the provision_primary_user service", function() {
createController({
ready: function() {
......
......@@ -67,12 +67,6 @@
equal(error, "start: controller must be specified", "creating a state machine without a controller fails");
});
test("offline does offline", function() {
mediator.publish("offline");
equal(actions.called.doOffline, true, "controller is offline");
});
test("user_staged - call doConfirmUser", function() {
mediator.publish("user_staged", {
email: "testuser@testuser.com"
......@@ -359,7 +353,7 @@
equal(error, "invalid email", "expected exception thrown");
});
test("null assertion generated - preserve original options in doPickEmail", function() {
mediator.publish("start", { allowPersistent: true });
mediator.publish("assertion_generated", { assertion: null });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment