Merge remote-tracking branch 'origin/develop' into develop

Conflicts:
	web/app/views/shared/_ga.html.erb
This commit is contained in:
Anthony Davis 2014-05-29 21:58:22 -05:00
commit c752fdacd7
6 changed files with 37 additions and 8 deletions

View File

@ -34,6 +34,7 @@
var $currentScore = null;
var $scoredClients = null;
var $subscore = null;
var backendGuardTimeout = null;
var serverClientId = '';
var isScoring = false;
@ -113,6 +114,10 @@
context.JK.alertSupportedNeeded("JamKazam is experiencing technical difficulties.");
renderStopTest('', '');
}
else if(reason == 'backend_gone') {
context.JK.alertSupportedNeeded("The JamKazam client is experiencing technical difficulties.");
renderStopTest('', '');
}
else if(reason == "invalid_response") {
context.JK.alertSupportedNeeded("The JamKazam client software had an unexpected problem while scoring your Internet connection. Reason=" + attempt.backend_data.reason + '.');
renderStopTest('', '');
@ -151,6 +156,17 @@
return testSummary.attempts[testSummary.attempts.length - 1];
}
function backendTimedOut() {
testSummary.final = {reason: 'backend_gone'}
testFinished();
}
function clearBackendGuard() {
if(backendGuardTimeout) {
clearTimeout(backendGuardTimeout);
backendGuardTimeout = null;
}
}
function attemptTestPass() {
@ -162,7 +178,6 @@
attempt.server_client_id = serverClientId;
attempt.received_progress = false;
testSummary.attempts.push(attempt);
console.log("pushing attempt: " + testSummary.attempts.length)
//context.jamClient.StopNetworkTest('');
@ -170,6 +185,8 @@
updateProgress(0, false);
backendGuardTimeout = setTimeout(function(){backendTimedOut()}, gon.ftue_network_test_duration + 1000);
context.jamClient.TestNetworkPktBwRate(serverClientId, TEST_SUCCESS_CALLBACK, TEST_TIMEOUT_CALLBACK,
NETWORK_TEST_TYPES.PktTest400LowLatency,
gon.ftue_network_test_duration,
@ -257,6 +274,8 @@
}
function networkTestSuccess(data) {
clearBackendGuard();
var attempt = getCurrentAttempt();
function refineTest(up) {
@ -366,6 +385,8 @@
}
function networkTestTimeout(data) {
clearBackendGuard();
logger.warn("network timeout when testing latency test: " + data);
var attempt = getCurrentAttempt();
@ -410,6 +431,10 @@
reset();
}
function afterHide() {
}
function initialize(_$step) {
$step = _$step;
@ -427,6 +452,7 @@
}
this.newSession = newSession;
this.afterHide = afterHide;
this.beforeShow = beforeShow;
this.initialize = initialize;

View File

@ -1056,7 +1056,8 @@
clearOutputPorts();
resetFrameBuffers();
}
function beforeHide() {
function afterHide() {
logger.debug("unregistering focus watch")
$(window).off('focus', onFocus);
}
@ -1098,7 +1099,7 @@
this.handleNext = handleNext;
this.beforeShow = beforeShow;
this.beforeHide = beforeHide;
this.afterHide = afterHide;
this.initialize = initialize;
self = this;

View File

@ -201,11 +201,13 @@
}
function renderNotConnected() {
console.log("RENDER NOT CONNECTED!!!!!!!!!")
$interactionBlocker.addClass('active');
$disconnectedMsg.addClass('active');
}
function renderConnected() {
console.log("RENDER CONNECTED!!!!!!!!!")
$interactionBlocker.removeClass('active');
$disconnectedMsg.removeClass('active');
}

View File

@ -253,7 +253,7 @@
}
JK.app = JK.JamKazam();
var jamServer = new JK.JamServer(JK.app, function(event_type) {});
var jamServer = new JK.JamServer(JK.app, function(event_type) {JK.app.activeElementEvent(event_type)});
jamServer.initialize();
JK.initJamClient();

View File

@ -1,4 +1,4 @@
<% if current_user.nil? || !Rails.application.config.ga_suppress_admin || !current_user.admin? || request.user_agent != 'monitor' %>
<% if request.user_agent != "monitor" && (current_user.nil? || !Rails.application.config.ga_suppress_admin || !current_user.admin?) # remove admin users from GA %>
<script>
(function(context) {
if(context.jamClient) {

View File

@ -88,15 +88,15 @@ describe "Bands", :js => true, :type => :feature, :capybara_feature => true do
end
it "limits genres to 3" do
genres = Genre.limit(4)
navigate_band_setup
within('#band-setup-form') do
fill_in 'band-name', with: "whatever"
fill_in 'band-biography', with: "a good story"
all('#band-genres input[type="checkbox"]').each_with_index do |cb, i|
cb.trigger(:click) unless i > 3
genres.each do |genre|
find("#band-genres input[value='#{genre.id}']").trigger(:click)
end
end
sleep 1
find('#btn-band-setup-next').trigger(:click)
expect(page).to have_selector('#tdBandGenres .error-text li', text: "No more than 3 genres are allowed.")
end