don't load the janky test framework that we aren't even using

This commit is contained in:
ansuz 2021-11-22 16:35:35 +05:30
parent cb737d46c4
commit 15cf523144
10 changed files with 57 additions and 41 deletions

View File

@ -554,7 +554,7 @@ define([
return;
}
if (testing) { return void proceed(result); }
//if (testing) { return void proceed(result); }
if (!(proxy.curvePrivate && proxy.curvePublic &&
proxy.edPrivate && proxy.edPublic)) {

View File

@ -3,7 +3,7 @@ define([
'/bower_components/hyperjson/hyperjson.js',
'json.sortify',
'/drive/tests.js',
'/common/test.js',
//'/common/test.js',
'/common/common-hash.js',
'/common/common-util.js',
'/common/common-thumbnail.js',
@ -18,7 +18,7 @@ define([
'/bower_components/tweetnacl/nacl-fast.min.js',
'less!/customize/src/less2/pages/page-assert.less',
], function ($, Hyperjson, Sortify, Drive, Test, Hash, Util, Thumb, Wire, Flat, MediaTag, Block, ApiConfig, Assertions, h, Messages) {
], function ($, Hyperjson, Sortify, Drive, /*Test,*/ Hash, Util, Thumb, Wire, Flat, MediaTag, Block, ApiConfig, Assertions, h, Messages) {
window.Hyperjson = Hyperjson;
window.Sortify = Sortify;
var Nacl = window.nacl;
@ -526,11 +526,12 @@ define([
})),
]));
/*
if (failed) {
Test.failed();
} else {
Test.passed();
}
}*/
});
});

View File

@ -18,14 +18,14 @@ define([
'/lib/tippy/tippy.min.js',
'/common/hyperscript.js',
'/customize/loading.js',
'/common/test.js',
//'/common/test.js',
'/lib/jquery-ui/jquery-ui.min.js', // autocomplete widget
'/bower_components/bootstrap-tokenfield/dist/bootstrap-tokenfield.js',
'css!/lib/tippy/tippy.css',
'css!/lib/jquery-ui/jquery-ui.min.css'
], function ($, Messages, Util, Hash, Notifier, AppConfig,
Alertify, Tippy, h, Loading, Test) {
Alertify, Tippy, h, Loading/*, Test */) {
var UI = {};
/*
@ -994,7 +994,7 @@ define([
// Release the test blocker, hopefully every test has been registered.
// This test is created in sframe-boot2.js
cb = cb || function () {};
if (Test.__ASYNC_BLOCKER__) { Test.__ASYNC_BLOCKER__.pass(); }
//if (Test.__ASYNC_BLOCKER__) { Test.__ASYNC_BLOCKER__.pass(); }
var $loading = $('#' + LOADING);
$loading.addClass("cp-loading-hidden"); // Hide the loading screen

View File

@ -38,8 +38,8 @@ define([
Feedback,
Snapshots,
AppConfig,
ChainPad,
Test)
ChainPad /*,
/* Test */)
{
var SaveAs = window.saveAs;
@ -87,6 +87,7 @@ define([
var contentContainer = options.contentContainer ||
(function () { throw new Error("contentContainer must be specified"); }());
/*
Test(function (t) {
console.log("Here is the test");
evOnReady.reg(function () {
@ -96,6 +97,7 @@ define([
});
});
});
*/
var onLocal;
var textContentGetter;
@ -779,7 +781,7 @@ define([
}).nThen(function (waitFor) {
common.getSframeChannel().onReady(waitFor());
}).nThen(function (waitFor) {
Test.registerInner(common.getSframeChannel());
//Test.registerInner(common.getSframeChannel());
common.handleNewFile(waitFor);
}).nThen(function (waitFor) {
cpNfInner = common.startRealtime({

View File

@ -2,8 +2,8 @@
// Note: This must only be loaded from inside of a sandbox-iframe.
define([
'/common/requireconfig.js',
'/common/test.js'
], function (RequireConfig, Test) {
//'/common/test.js'
], function (RequireConfig /*, Test */) {
require.config(RequireConfig());
// most of CryptPad breaks if you don't support isArray
@ -29,7 +29,7 @@ define([
// This test is for keeping the testing infrastructure operating
// until all tests have been registered.
// This test is completed in common-interface.js
Test(function (t) { Test.__ASYNC_BLOCKER__ = t; });
//Test(function (t) { Test.__ASYNC_BLOCKER__ = t; });
window.onerror = function (e) {
if (/requirejs\.org/.test(e)) {

View File

@ -80,7 +80,7 @@ define([
nThen: nThen
};
var AppConfig;
var Test;
//var Test;
var password, newPadPassword, newPadPasswordForce;
var initialPathInDrive;
var burnAfterReading;
@ -113,11 +113,11 @@ define([
'/common/outer/local-store.js',
'/common/outer/cache-store.js',
'/customize/application_config.js',
'/common/test.js',
//'/common/test.js',
'/common/userObject.js',
], waitFor(function (_CpNfOuter, _Cryptpad, _Crypto, _Cryptget, _SFrameChannel,
_SecureIframe, _UnsafeIframe, _OOIframe, _Messaging, _Notifier, _Hash, _Util, _Realtime, _Notify,
_Constants, _Feedback, _LocalStore, _Cache, _AppConfig, _Test, _UserObject) {
_Constants, _Feedback, _LocalStore, _Cache, _AppConfig, /* _Test,*/ _UserObject) {
CpNfOuter = _CpNfOuter;
Cryptpad = _Cryptpad;
Crypto = Utils.Crypto = _Crypto;
@ -139,7 +139,7 @@ define([
Utils.Notify = _Notify;
Utils.currentPad = currentPad;
AppConfig = _AppConfig;
Test = _Test;
//Test = _Test;
if (localStorage.CRYPTPAD_URLARGS !== ApiConfig.requireConf.urlArgs) {
console.log("New version, flushing cache");
@ -715,7 +715,7 @@ define([
sframeChan.event('EV_LOGOUT');
});
Test.registerOuter(sframeChan);
//Test.registerOuter(sframeChan);
Cryptpad.onNewVersionReconnect.reg(function () {
sframeChan.event("EV_NEW_VERSION");
@ -2138,8 +2138,8 @@ define([
Utils.Feedback.reportAppUsage();
if (!realtime && !Test.testing) { return; }
if (isNewFile && cfg.useCreationScreen && !Test.testing) { return; }
if (!realtime /*&& !Test.testing*/) { return; }
if (isNewFile && cfg.useCreationScreen /* && !Test.testing */) { return; }
if (burnAfterReading) { return; }
//if (isNewFile && Utils.LocalStore.isLoggedIn()
// && AppConfig.displayCreationScreen && cfg.useCreationScreen) { return; }

View File

@ -6,10 +6,10 @@ define([
'/common/common-realtime.js',
'/common/common-feedback.js',
'/common/outer/local-store.js',
'/common/test.js',
//'/common/test.js',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
], function ($, Cryptpad, Login, UI, Realtime, Feedback, LocalStore, Test) {
], function ($, Cryptpad, Login, UI, Realtime, Feedback, LocalStore /*, Test */) {
$(function () {
var $checkImport = $('#import-recent');
if (LocalStore.isLoggedIn()) {
@ -43,17 +43,19 @@ define([
$('button.login').click();
});
var test;
//var test;
$('button.login').click(function () {
var shouldImport = $checkImport[0].checked;
var uname = $uname.val();
var passwd = $passwd.val();
Login.loginOrRegisterUI(uname, passwd, false, shouldImport, Test.testing, function () {
Login.loginOrRegisterUI(uname, passwd, false, shouldImport, /*Test.testing */ false, function () {
/*
if (test) {
localStorage.clear();
test.pass();
//test.pass();
return true;
}
*/
});
});
$('#register').on('click', function () {
@ -64,11 +66,13 @@ define([
window.location.href = '/register/' + hash;
});
/*
Test(function (t) {
$uname.val('testuser');
$passwd.val('testtest');
test = t;
$('button.login').click();
});
*/
});
});

View File

@ -27,7 +27,7 @@ define([
'/bower_components/hyperjson/hyperjson.js',
'/common/sframe-app-framework.js',
'/common/cursor.js',
'/common/TypingTests.js',
//'/common/TypingTests.js',
'/customize/messages.js',
'/pad/links.js',
'/pad/comments.js',
@ -42,8 +42,8 @@ define([
'/common/common-ui-elements.js',
'/common/hyperscript.js',
'/bower_components/chainpad/chainpad.dist.js',
'/customize/application_config.js',
'/common/test.js',
//'/customize/application_config.js',
//'/common/test.js',
'/lib/diff-dom/diffDOM.js',
'/bower_components/file-saver/FileSaver.min.js',
@ -57,7 +57,7 @@ define([
Hyperjson,
Framework,
Cursor,
TypingTest,
//TypingTest,
Messages,
Links,
Comments,
@ -71,9 +71,9 @@ define([
UI,
UIElements,
h,
ChainPad,
ChainPad/*,
AppConfig,
Test
Test */
) {
var DiffDom = window.diffDOM;
@ -1249,6 +1249,7 @@ define([
// export the typing tests to the window.
// call like `test = easyTest()`
// terminate the test like `test.cancel()`
/*
window.easyTest = function() {
cursor.update();
//var start = cursor.Range.start;
@ -1257,6 +1258,7 @@ define([
framework.localChange();
return test;
};
*/
// Fix the scrollbar if it's reset when clicking on a button (firefox only?)
@ -1509,6 +1511,7 @@ define([
Links.init(Ckeditor, editor, openLinkSetting);
require(['/pad/csp.js'], waitFor());
}).nThen(function( /*waitFor*/ ) {
/*
function launchAnchorTest(test) {
// -------- anchor test: make sure the exported anchor contains <a name="..."> -------
@ -1572,16 +1575,17 @@ define([
if (editor.status === "ready") {
window.clearInterval(intervalHandle);
console.log("Editor is ready.");
tryAndTestExport();
tryAndTestExport(); // XXX
} else {
console.log("Waiting for editor to be ready.");
}
}, 100);
}
/*
Test(function(test) {
launchAnchorTest(test);
});
});*/
andThen2(editor, Ckeditor, framework);
});
};

View File

@ -50,8 +50,8 @@ define([
h,
Messages,
SFCodeMirror,
CMeditor,
Test)
CMeditor/*,
Test*/)
{
var saveAs = window.saveAs;
@ -1010,6 +1010,7 @@ define([
publish(true);
}
/*
var passIfOk = function (t) {
t.assert($('#cp-app-poll-description-published').text().indexOf(
"Content for the description") === 0);
@ -1023,7 +1024,9 @@ define([
t.assert($('input[value="Meeee"]').length === 1);
t.pass();
};
*/
/*
if (!APP.readOnly) {
console.log("Here is the test");
Test(function (t) {
@ -1075,13 +1078,14 @@ define([
setTimeout(waitFor());
}).nThen(function (waitFor) {
APP.rt.realtime.onSettle(waitFor());
}).nThen(function (/*waitFor*/) {
}).nThen(function (/*waitFor*/ /*) {
passIfOk(t);
});
});
} else {
Test(passIfOk);
}
*/
// No need for onLocal in openPadChat because in poll, we listen for metadata changes
// and save them everytime.
@ -1315,7 +1319,7 @@ define([
}).nThen(function (waitFor) {
common.handleNewFile(waitFor);
}).nThen(function (/* waitFor */) {
Test.registerInner(common.getSframeChannel());
//Test.registerInner(common.getSframeChannel());
var metadataMgr = common.getMetadataMgr();
metadataMgr.setDegraded(false); // FIXME degarded mode unsupported (no cursor channel)

View File

@ -2,7 +2,7 @@ define([
'jquery',
'/customize/login.js',
'/common/cryptpad-common.js',
'/common/test.js',
//'/common/test.js',
'/common/common-credential.js',
'/common/common-interface.js',
'/common/common-util.js',
@ -13,7 +13,7 @@ define([
'/common/hyperscript.js',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
], function ($, Login, Cryptpad, Test, Cred, UI, Util, Realtime, Constants, Feedback, LocalStore, h) {
], function ($, Login, Cryptpad, /*Test,*/ Cred, UI, Util, Realtime, Constants, Feedback, LocalStore, h) {
var Messages = Cryptpad.Messages;
$(function () {
if (LocalStore.isLoggedIn()) {
@ -111,7 +111,7 @@ define([
function (yes) {
if (!yes) { return; }
Login.loginOrRegisterUI(uname, passwd, true, shouldImport, Test.testing, function () {
Login.loginOrRegisterUI(uname, passwd, true, shouldImport, false /*Test.testing*/, function () {
if (test) {
localStorage.clear();
test.pass();
@ -149,6 +149,7 @@ define([
}
});
/*
Test(function (t) {
test = t;
$uname.val('testuser');
@ -161,6 +162,6 @@ define([
window.setTimeout(function () {
UI.findOKButton().click();
}, 1000);
});
}); */
});
});