This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Justin Vaillancourt
committed
Sep 30, 2014
1 parent
e614122
commit db6aeb4
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="/test/qunit/qunit.css"> | ||
<script src="/test/qunit/qunit.js"></script> | ||
|
||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | ||
<script src="/lib/underscore.js"></script> | ||
<script> | ||
// externals.js dependencies: | ||
// - jquery | ||
// - underscore | ||
// - Mobify.(config.tagVersion|_|$|timing.addPoint) | ||
// - jquery.mapattributes.js | ||
// - unmobify | ||
|
||
// Fake out the tag. | ||
Mobify = { | ||
config: {tagVersion: '7.0.0'}, | ||
_: _, | ||
$: $, | ||
timing: {addPoint: function(){}} | ||
} | ||
</script> | ||
<script src="/lib/jquery/jquery.mapattributes.js"></script> | ||
<script src="/api/externals.js"></script> | ||
<script src="/unmobify.js"></script> | ||
<script src="/api/data2.js"></script> | ||
<script src="/api/stack.js"></script> | ||
<script src="/api/cont.js"></script> | ||
</head> | ||
<body> | ||
<!-- | ||
Usage: | ||
# Run test-server for checkout folder. | ||
$ node test/test-server.js | ||
# Navigate to this page: | ||
$ http://127.0.0.1:8001/test/context-test.html | ||
--> | ||
<h1 id="qunit-header">QUnit Test Suite</h1> | ||
<h2 id="qunit-banner"></h2> | ||
<div id="qunit-testrunner-toolbar"></div> | ||
<h2 id="qunit-userAgent"></h2> | ||
<ol id="qunit-tests"></ol> | ||
|
||
<script> | ||
// There is a bug on iOS 8.0 where: | ||
// `body`.innerHTML = '<form></form><form></form>'; | ||
// produces the following elements: | ||
// `<form><form></form></form>` | ||
// | ||
// This test ensures that capturing works as expected. | ||
// | ||
asyncTest('Mobify.html.extractDOM correctly extracts document with two sibbling forms', function() { | ||
var $iframe = $('<iframe src="/test/fixtures-externals/plaintext-sibbling-forms.html">'); | ||
|
||
$iframe.one('load', function() { | ||
var doc = $iframe.get(0).contentDocument; | ||
var content = Mobify.externals.grabContent(doc); | ||
var children = content.$body.children(); | ||
|
||
equal(children.length, 2, 'extracted body has two children'); | ||
equal(children[0].nodeName, 'FORM', 'first child element is a form'); | ||
equal(children[1].nodeName, 'FORM', 'second child element is a form'); | ||
|
||
start(); | ||
}); | ||
$('body').append($iframe); | ||
}); | ||
</script> | ||
<body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script> | ||
// Simulate mobify | ||
document.write("<plaintext style=\"display:none\">"); | ||
</script> | ||
</head> | ||
<body> | ||
<form></form> | ||
<form></form> | ||
</body> | ||
</html> |