Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Commit

Permalink
landing frame, fullscreen, and no script which uses onload and page l…
Browse files Browse the repository at this point in the history
…oad event. Fullscreen also uses a delay.
  • Loading branch information
taboca committed Mar 27, 2011
1 parent 81a22a8 commit 861ac43
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/frame_buster/test-app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

const m = require("main");
const timer = require("timer");

exports.testBrowser = function (test) {

var callbacks = {

onload: function () {
var mainBrowser= m.getAppBrowser();
var mainDoc = mainBrowser.contentDocument;
var appWindow = m.getAppWindow;

mainBrowser.contentWindow.addEventListener("load", function pageLoaded() {

test.assert( mainDoc.location != mainDoc.getElementById("inner").contentDocument.location);
test.done();

},false);

},

quit: function() {
test.pass();
test.done();
}

};

test.waitUntilDone();
m.main( options, callbacks);
}
36 changes: 36 additions & 0 deletions tests/fullscreen/test-app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

const m = require("main");
const timer = require("timer");

exports.testBrowser = function (test) {

var callbacks = {

onload: function () {
var mainBrowser= m.getAppBrowser();
var mainWin = mainBrowser.contentWindow;

var originalWidth = mainWin.innerWidth;
mainWin.addEventListener("load", function pageLoaded() {
timer.setTimeout(function delayedTest() {
var currentWidth = mainWin.innerWidth;
test.assert( originalWidth != currentWidth);
test.done();
},500);
},false);

},

quit: function() {
test.pass();
test.done();
}

};

test.waitUntilDone();
m.main( options, callbacks);
}

function delayedTest() {
}
27 changes: 27 additions & 0 deletions tests/noscript/test-app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

const m = require("main");
const timer = require("timer");

exports.testBrowser = function (test) {

var callbacks = {

onload: function () {
var mainBrowser= m.getAppBrowser();
var mainDoc = mainBrowser.contentDocument;
mainBrowser.contentWindow.addEventListener("load", function pageLoaded() {
test.assert( mainDoc.getElementById("inner").contentDocument.getElementById("posterousbar_nojs") == null);
test.done();
},false);
},

quit: function() {
test.pass();
test.done();
}

};

test.waitUntilDone();
m.main( options, callbacks);
}

0 comments on commit 861ac43

Please sign in to comment.