Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging generated clipboard API tests #1242

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4a00c77
adding clipboard API tests
Sep 13, 2014
f6d5c93
adding helper files
Sep 13, 2014
21cd455
Added script that extracts tests from spec source code and generates …
Sep 14, 2014
9ee689a
mostly minor fixes
Oct 10, 2014
b00e6a1
giving test files more meaningful names, avoid numbers that change ev…
Dec 5, 2014
cd31aef
changed test order in testlist.rb
Dec 19, 2014
ec7637c
renaming some test because file names were too long, adding some new
Jul 22, 2015
c9465e8
Whitespace fixes and other stuff to make Travis happy
Jul 22, 2015
cad1fb7
and a few more whitespace fixes in helper files
Jul 22, 2015
0dda6bc
dropping Ruby file listing test cases and code to generate it - legac…
Jul 26, 2015
6f7981d
integrating test setup with testharness.js, addresses https://critic.…
Jul 26, 2015
3e0994b
small fixes for better testharness.js integration
Jul 26, 2015
ec27e08
removed two tests expecting execCommand(paste) to work
Jul 26, 2015
fa24da7
various testharness.js integration fixes and test errata
Jul 26, 2015
a6f7313
Remove pointless whitespace in front of test titles
Jul 26, 2015
0912abc
removing clipboard event constructor config that is not being tested
Jul 26, 2015
19df515
spec changed event object construction, tests need fixing
Jul 26, 2015
d5eeb16
adding clipboard API tests
Sep 13, 2014
b009493
mostly minor fixes
Oct 10, 2014
0b48476
giving test files more meaningful names, avoid numbers that change ev…
Dec 5, 2014
13794e6
changed test order in testlist.rb
Dec 19, 2014
afb1a78
renaming some test because file names were too long, adding some new
Jul 22, 2015
45f9ed2
Whitespace fixes and other stuff to make Travis happy
Jul 22, 2015
95a9e02
and a few more whitespace fixes in helper files
Jul 22, 2015
7167eb1
dropping Ruby file listing test cases and code to generate it - legac…
Jul 26, 2015
9f98704
integrating test setup with testharness.js, addresses https://critic.…
Jul 26, 2015
f4c1521
small fixes for better testharness.js integration
Jul 26, 2015
2586cc7
removed two tests expecting execCommand(paste) to work
Jul 26, 2015
fb90652
various testharness.js integration fixes and test errata
Jul 26, 2015
b2bb1bf
Remove pointless whitespace in front of test titles
Jul 26, 2015
4e1be0e
removing clipboard event constructor config that is not being tested
Jul 26, 2015
77c7659
spec changed event object construction, tests need fixing
Jul 26, 2015
e0dc50d
removing some trailing whitespace Travis doesn't like.. again..
Jul 26, 2015
19806f6
stop defining so many global variables
Jul 26, 2015
6f32823
use testharness.js step_timeout instead of setTimeout()
Jul 26, 2015
a3144ac
changing where buttons for manual result reporting go
Jul 26, 2015
3cd1e2e
removing local path and print statement
Jul 27, 2015
ff638f9
dropping unnecessary try usage, better testharness.js usage
Jul 27, 2015
df3ee1b
new isTrusted tests
Aug 3, 2015
9378fb2
Fixing execCommand() arguments
Aug 3, 2015
ba3da2a
Clarify failure reason if cut fails by switching order of asserts
Feb 4, 2016
ffd8b73
Reordering asserts to make failures easier to debug
Feb 25, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>Clipboard API - cancelling default action, basic test - copy on document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/_lib.js"></script>
<script>
/** cancelling default action, basic test */
/* Events: copy cut */
/* Test HTML: <form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>*/
/* Targets: document 'input_text' */
/* paste data: "clipboard text" */
/* External pass condition - clipboard data: "clipboard text" */
function clipboard_api_test(e){
e.preventDefault();
}

</script>
</head>
<body>

<p>FAILED (This TC requires JavaScript enabled)</p>
<form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>
<div id="log"></div>
<script>
(function(){
var t = async_test()
var dataToPaste="clipboard text" ;
var extPassCond="clipboard text" ;
var eventTarget=document;
var eventType='copy';
setup(function(){
setupTest(t, eventTarget, eventType, dataToPaste, extPassCond );
});
})();
</script>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>Clipboard API - cancelling default action, basic test - copy on 'input_text'</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/_lib.js"></script>
<script>
/** cancelling default action, basic test */
/* Events: copy cut */
/* Test HTML: <form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>*/
/* Targets: document 'input_text' */
/* paste data: "clipboard text" */
/* External pass condition - clipboard data: "clipboard text" */
function clipboard_api_test(e){
e.preventDefault();
}

</script>
</head>
<body>

<p>FAILED (This TC requires JavaScript enabled)</p>
<form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>
<div id="log"></div>
<script>
(function(){
var t = async_test()
var dataToPaste="clipboard text" ;
var extPassCond="clipboard text" ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything with an external pass condition can't be verified through JS and therefore needs to be -manual.

var eventTarget='input_text';
var eventType='copy';
setup(function(){
setupTest(t, eventTarget, eventType, dataToPaste, extPassCond );
});
})();
</script>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>Clipboard API - cancelling default action, basic test - cut on document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/_lib.js"></script>
<script>
/** cancelling default action, basic test */
/* Events: copy cut */
/* Test HTML: <form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>*/
/* Targets: document 'input_text' */
/* paste data: "clipboard text" */
/* External pass condition - clipboard data: "clipboard text" */
function clipboard_api_test(e){
e.preventDefault();
}

</script>
</head>
<body>

<p>FAILED (This TC requires JavaScript enabled)</p>
<form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>
<div id="log"></div>
<script>
(function(){
var t = async_test()
var dataToPaste="clipboard text" ;
var extPassCond="clipboard text" ;
var eventTarget=document;
var eventType='cut';
setup(function(){
setupTest(t, eventTarget, eventType, dataToPaste, extPassCond );
});
})();
</script>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>Clipboard API - cancelling default action, basic test - cut on 'input_text'</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/_lib.js"></script>
<script>
/** cancelling default action, basic test */
/* Events: copy cut */
/* Test HTML: <form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>*/
/* Targets: document 'input_text' */
/* paste data: "clipboard text" */
/* External pass condition - clipboard data: "clipboard text" */
function clipboard_api_test(e){
e.preventDefault();
}

</script>
</head>
<body>

<p>FAILED (This TC requires JavaScript enabled)</p>
<form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>
<div id="log"></div>
<script>
(function(){
var t = async_test()
var dataToPaste="clipboard text" ;
var extPassCond="clipboard text" ;
var eventTarget='input_text';
var eventType='cut';
setup(function(){
setupTest(t, eventTarget, eventType, dataToPaste, extPassCond );
});
})();
</script>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>Clipboard API - cancelling default action of cut prevents removal of text from editable context - cut on document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/_lib.js"></script>
<script>
/** cancelling default action of cut prevents removal of text from editable context */
/* Events: cut */
/* Test HTML: <form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>*/
/* Targets: document 'input_text' */
function clipboard_api_test(e, test_obj){
e.preventDefault();
var theTarget=e.target;
test_obj.step_timeout( function(){ var passed = theTarget.value === theTarget.defaultValue; result(passed); }, 10 );
}

</script>
</head>
<body>

<p>FAILED (This TC requires JavaScript enabled)</p>
<form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>
<div id="log"></div>
<script>
(function(){
var t = async_test()
var dataToPaste='';
var extPassCond=null;
var eventTarget=document;
var eventType='cut';
setup(function(){
setupTest(t, eventTarget, eventType, dataToPaste, extPassCond );
});
})();
</script>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>Clipboard API - cancelling default action of cut prevents removal of text from editable context - cut on 'input_text'</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/_lib.js"></script>
<script>
/** cancelling default action of cut prevents removal of text from editable context */
/* Events: cut */
/* Test HTML: <form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>*/
/* Targets: document 'input_text' */
function clipboard_api_test(e, test_obj){
e.preventDefault();
var theTarget=e.target;
test_obj.step_timeout( function(){ var passed = theTarget.value === theTarget.defaultValue; result(passed); }, 10 );
}

</script>
</head>
<body>

<p>FAILED (This TC requires JavaScript enabled)</p>
<form><input id="input_text" autofocus onfocus="this.select()" value="copied text"></form>
<div id="log"></div>
<script>
(function(){
var t = async_test()
var dataToPaste='';
var extPassCond=null;
var eventTarget='input_text';
var eventType='cut';
setup(function(){
setupTest(t, eventTarget, eventType, dataToPaste, extPassCond );
});
})();
</script>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>Clipboard API - clearData() called outside event handler method - copy on document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/_lib.js"></script>
<script>
/** clearData() called outside event handler method */
/* Events: copy cut paste */
/* paste data: "clipboard text" */
/* External pass condition - clipboard data: "clipboard text" */
function clipboard_api_test(e, test_obj){
var cbData=e.clipboardData;
test_obj.step_timeout(function(){
cbData.clearData();
}, 1);
e.preventDefault();
}

</script>
</head>
<body>

<p>FAILED (This TC requires JavaScript enabled)</p>
<form>
<input id="input_text" autofocus onfocus="this.select()" value="copied text">
</form>
<div id="log"></div>
<script>
(function(){
var t = async_test()
var dataToPaste="clipboard text" ;
var extPassCond="clipboard text" ;
var eventTarget=document;
var eventType='copy';
setup(function(){
setupTest(t, eventTarget, eventType, dataToPaste, extPassCond );
});
})();
</script>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>Clipboard API - clearData() called outside event handler method - cut on document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/_lib.js"></script>
<script>
/** clearData() called outside event handler method */
/* Events: copy cut paste */
/* paste data: "clipboard text" */
/* External pass condition - clipboard data: "clipboard text" */
function clipboard_api_test(e, test_obj){
var cbData=e.clipboardData;
test_obj.step_timeout(function(){
cbData.clearData();
}, 1);
e.preventDefault();
}

</script>
</head>
<body>

<p>FAILED (This TC requires JavaScript enabled)</p>
<form>
<input id="input_text" autofocus onfocus="this.select()" value="copied text">
</form>
<div id="log"></div>
<script>
(function(){
var t = async_test()
var dataToPaste="clipboard text" ;
var extPassCond="clipboard text" ;
var eventTarget=document;
var eventType='cut';
setup(function(){
setupTest(t, eventTarget, eventType, dataToPaste, extPassCond );
});
})();
</script>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>Clipboard API - clearData() called outside event handler method - paste on document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/_lib.js"></script>
<script>
/** clearData() called outside event handler method */
/* Events: copy cut paste */
/* paste data: "clipboard text" */
/* External pass condition - clipboard data: "clipboard text" */
function clipboard_api_test(e, test_obj){
var cbData=e.clipboardData;
test_obj.step_timeout(function(){
cbData.clearData();
}, 1);
e.preventDefault();
}

</script>
</head>
<body>

<p>FAILED (This TC requires JavaScript enabled)</p>
<form>
<input id="input_text" autofocus onfocus="this.select()" value="copied text">
</form>
<div id="log"></div>
<script>
(function(){
var t = async_test()
var dataToPaste="clipboard text" ;
var extPassCond="clipboard text" ;
var eventTarget=document;
var eventType='paste';
setup(function(){
setupTest(t, eventTarget, eventType, dataToPaste, extPassCond );
});
})();
</script>
</body></html>
Loading