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

Optimize lock-bad-argument.html #9291

Merged
merged 3 commits into from Feb 26, 2018

Conversation

Projects
None yet
4 participants
@Honry
Copy link
Contributor

Honry commented Jan 31, 2018

  • centralize invalid lock type
  • simplified with promise_test
  • remove incorrect invaild_lock_type
@w3c-bots

This comment has been minimized.

Copy link

w3c-bots commented Jan 31, 2018

Build PASSED

Started: 2018-02-26 09:52:07
Finished: 2018-02-26 09:59:54

Failing Jobs

  • build_css
  • chrome:dev
  • safari:11.0
  • MicrosoftEdge:16.16299

View more information about this build on:

Optimize lock-bad-argument.html
 - centralize invalid lock type
 - simplified with promise_test
 - remove incorrect invaild_lock_type
@Honry

This comment has been minimized.

Copy link
Contributor Author

Honry commented Feb 26, 2018

marcoscaceres added some commits Feb 26, 2018

Prettier code, cleanup
promise_test(t => {
  const invalid_lock_types = [
    "invalid-orientation",
    null,
    undefined,
    123,
    window,
    ["portrait-primary", "landscape-primary"],
  ];
  const promisesToReject = invalid_lock_types.map(type =>
    promise_rejects(t, new TypeError(), screen.orientation.lock(type))
  );
  return Promise.all(promisesToReject);
}, "screen.orientation.lock() must throw given invalid input.");

promise_test(t => {
  return promise_rejects(t, new TypeError(), screen.orientation.lock());
}, "screen.orientation.lock() must throw when the input is missing.");
@marcoscaceres
Copy link
Contributor

marcoscaceres left a comment

Sorry about that first commit, I pasted my code into the wrong place lol!

@marcoscaceres

This comment has been minimized.

Copy link
Contributor

marcoscaceres commented Feb 26, 2018

Your rewrite was way nicer than the original, btw... I just sprinkled a little bit of .

@Honry

This comment has been minimized.

Copy link
Contributor Author

Honry commented Feb 26, 2018

@marcoscaceres, you're nice. Thank you!

@Honry Honry merged commit c2adc6a into web-platform-tests:master Feb 26, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Honry Honry deleted the Honry:screen-orientation-1 branch Feb 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.