Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / script-tests / canvas-getContext-invalid.js
blobdec12679ad24d825856905bb1fe137784ae253ed
1 description("Test that invalid canvas getContext() requests return null.");
3 canvas = document.createElement('canvas');
5 shouldBe("canvas.getContext('')", "null");
6 shouldBe("canvas.getContext('2d#')", "null");
7 shouldBe("canvas.getContext('This is clearly not a valid context name.')", "null");
8 shouldBe("canvas.getContext('2d\0')", "null");
9 shouldBe("canvas.getContext('2\uFF44')", "null");
10 shouldBe("canvas.getContext('2D')", "null");
11 shouldThrow("canvas.getContext()");
12 shouldBe("canvas.getContext('null')", "null");
13 shouldBe("canvas.getContext('undefined')", "null");