Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-allowedState.html

Issue 478223002: XMLHttpRequest::overrideMimeType should throw InvalidStateError (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add tests Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="/js-test-resources/js-test.js"></script>
3 <script>
4 jsTestIsAsync = true;
5
6 function testOverrideMimeType(xhr) {
7 debug("Testing overrideMimeType when readyState is " + xhr.readyState);
8
9 var isAllowed = xhr.readyState < XMLHttpRequest.LOADING;
10 if (isAllowed) {
11 shouldNotThrow("xhr.overrideMimeType('text/asdf')");
12 shouldNotThrow("xhr.overrideMimeType('text/plain')");
13 } else {
14 shouldThrow("xhr.overrideMimeType('text/asdf')");
tyoshino (SeeGerritForStatus) 2014/08/18 07:56:46 i think we should use a safe input e.g. "text/plai
kouhei (in TOK) 2014/08/18 09:29:21 Done.
15 }
16 }
17
18 var xhr = new XMLHttpRequest();
19 xhr.onreadystatechange = function() {
20 testOverrideMimeType(xhr);
21
22 if (xhr.readyState == XMLHttpRequest.DONE)
23 finishJSTest();
24 }
25
26 testOverrideMimeType(xhr);
27 xhr.open("GET", "resources/get.txt", true);
28 testOverrideMimeType(xhr);
29 xhr.send(null);
tyoshino (SeeGerritForStatus) 2014/08/18 07:56:45 check here too?
kouhei (in TOK) 2014/08/18 09:29:21 Done.
30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698