Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change NotSupportedError to TypeError in orientation.lock()
  • Loading branch information
Li Hao committed Jul 17, 2015
1 parent 545b538 commit 1864291
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
18 changes: 9 additions & 9 deletions screen-orientation/lockOrientation-bad-argument.html
Expand Up @@ -15,47 +15,47 @@

test.step(function() {
assert_equals(screen.orientation.type, 'portrait-primary');
assert_throws({ name: 'NotSupportedError' }, function() {
assert_throws(new TypeError(), function() {
screen.orientation.lock('invalid-orientation');
});

assert_equals(screen.orientation.type, 'portrait-primary');
assert_throws({ name: 'NotSupportedError' }, function() {
assert_throws(new TypeError(), function() {
screen.orientation.lock(null);
});

assert_equals(screen.orientation.type, 'portrait-primary');
assert_throws({ name: 'NotSupportedError' }, function() {
assert_throws(new TypeError(), function() {
screen.orientation.lock(undefined);
});

assert_equals(screen.orientation.type, 'portrait-primary');
assert_throws({ name: 'NotSupportedError' }, function() {
assert_throws(new TypeError(), function() {
screen.orientation.lock(undefined);
});

assert_equals(screen.orientation.type, 'portrait-primary');
assert_throws({ name: 'NotSupportedError' }, function() {
assert_throws(new TypeError(), function() {
screen.orientation.lock(123);
});

assert_equals(screen.orientation.type, 'portrait-primary');
assert_throws({ name: 'NotSupportedError' }, function() {
assert_throws(new TypeError(), function() {
screen.orientation.lock(window);
});

assert_equals(screen.orientation.type, 'portrait-primary');
assert_throws({ name: 'NotSupportedError' }, function() {
assert_throws(new TypeError(), function() {
screen.orientation.lock(['portrait-primary']);
});

assert_equals(screen.orientation.type, 'portrait-primary');
assert_throws({ name: 'NotSupportedError' }, function() {
assert_throws(new TypeError(), function() {
screen.orientation.lock(['portrait-primary', 'landscape-primary']);
});

assert_equals(screen.orientation.type, 'portrait-primary');
assert_throws({ name: 'TypeError' }, function() {
assert_throws(new TypeError(), function() {
screen.orientation.lock();
});
});
Expand Down
3 changes: 0 additions & 3 deletions screen-orientation/lockOrientation-sandboxed-iframe.html
Expand Up @@ -15,9 +15,6 @@

function runTestAllowed() {
window.onmessage = testAllowed.step_func(function (ev) {
// FIXME: re-enable when mock screen orientation controller is
// plugged to WebFrameTestProxy.
// assert_equals(ev.data, "", "screen.lockOrientation() does not throw");
assert_equals(ev.data, "portrait-primary", "screen.orientation lock to portrait-primary");
screen.orientation.unlock();
testAllowed.done();
Expand Down
2 changes: 1 addition & 1 deletion screen-orientation/page-visibility-manual.html
Expand Up @@ -5,7 +5,7 @@
<script src="/resources/testharnessreport.js"></script>
<meta name='flags' content='interact'>
<meta name="timeout" content="long">
<p>Switch the page to background, then switch back.</p>
<p>Switch the page to background, then switch back in a minute.</p>
<iframe src='about:blank'></iframe>
<script>

Expand Down

0 comments on commit 1864291

Please sign in to comment.