-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
hallvors
wants to merge
42
commits into
master
Choose a base branch
from
hallvors/clipboard-api-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
4a00c77
adding clipboard API tests
f6d5c93
adding helper files
21cd455
Added script that extracts tests from spec source code and generates …
9ee689a
mostly minor fixes
b00e6a1
giving test files more meaningful names, avoid numbers that change ev…
cd31aef
changed test order in testlist.rb
ec7637c
renaming some test because file names were too long, adding some new
c9465e8
Whitespace fixes and other stuff to make Travis happy
cad1fb7
and a few more whitespace fixes in helper files
0dda6bc
dropping Ruby file listing test cases and code to generate it - legac…
6f7981d
integrating test setup with testharness.js, addresses https://critic.…
3e0994b
small fixes for better testharness.js integration
ec27e08
removed two tests expecting execCommand(paste) to work
fa24da7
various testharness.js integration fixes and test errata
a6f7313
Remove pointless whitespace in front of test titles
0912abc
removing clipboard event constructor config that is not being tested
19df515
spec changed event object construction, tests need fixing
d5eeb16
adding clipboard API tests
b009493
mostly minor fixes
0b48476
giving test files more meaningful names, avoid numbers that change ev…
13794e6
changed test order in testlist.rb
afb1a78
renaming some test because file names were too long, adding some new
45f9ed2
Whitespace fixes and other stuff to make Travis happy
95a9e02
and a few more whitespace fixes in helper files
7167eb1
dropping Ruby file listing test cases and code to generate it - legac…
9f98704
integrating test setup with testharness.js, addresses https://critic.…
f4c1521
small fixes for better testharness.js integration
2586cc7
removed two tests expecting execCommand(paste) to work
fb90652
various testharness.js integration fixes and test errata
b2bb1bf
Remove pointless whitespace in front of test titles
4e1be0e
removing clipboard event constructor config that is not being tested
77c7659
spec changed event object construction, tests need fixing
e0dc50d
removing some trailing whitespace Travis doesn't like.. again..
19806f6
stop defining so many global variables
6f32823
use testharness.js step_timeout instead of setTimeout()
a3144ac
changing where buttons for manual result reporting go
3cd1e2e
removing local path and print statement
ff638f9
dropping unnecessary try usage, better testharness.js usage
df3ee1b
new isTrusted tests
9378fb2
Fixing execCommand() arguments
ba3da2a
Clarify failure reason if cut fails by switching order of asserts
ffd8b73
Reordering asserts to make failures easier to debug
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
clipboard-apis/cancelling_default_action_basic_test_copy_on_document.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,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> |
38 changes: 38 additions & 0 deletions
38
clipboard-apis/cancelling_default_action_basic_test_copy_on_inputtext.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,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" ; | ||
var eventTarget='input_text'; | ||
var eventType='copy'; | ||
setup(function(){ | ||
setupTest(t, eventTarget, eventType, dataToPaste, extPassCond ); | ||
}); | ||
})(); | ||
</script> | ||
</body></html> |
38 changes: 38 additions & 0 deletions
38
clipboard-apis/cancelling_default_action_basic_test_cut_on_document.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,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> |
38 changes: 38 additions & 0 deletions
38
clipboard-apis/cancelling_default_action_basic_test_cut_on_inputtext.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,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> |
38 changes: 38 additions & 0 deletions
38
...default_action_of_cut_prevents_removal_of_text_from_editable_context_cut_on_document.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,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> |
38 changes: 38 additions & 0 deletions
38
...efault_action_of_cut_prevents_removal_of_text_from_editable_context_cut_on_inputtext.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,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> |
42 changes: 42 additions & 0 deletions
42
clipboard-apis/cleardata_called_outside_event_handler_method_copy_on_document.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,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> |
42 changes: 42 additions & 0 deletions
42
clipboard-apis/cleardata_called_outside_event_handler_method_cut_on_document.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,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> |
42 changes: 42 additions & 0 deletions
42
clipboard-apis/cleardata_called_outside_event_handler_method_paste_on_document.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,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> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.