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

Import test cases from DVCS for Device Orientation Event #350

Merged
merged 8 commits into from Jun 13, 2016

Conversation

Projects
None yet
6 participants
@zqzhang
Contributor

zqzhang commented Sep 24, 2013

@hoppipolla-critic-bot

This comment has been minimized.

Show comment
Hide comment
@hoppipolla-critic-bot

hoppipolla-critic-bot Sep 24, 2013

Critic review: https://critic.hoppipolla.co.uk/r/330

This is an external review system which you may optionally use for the code review of your pull request.

hoppipolla-critic-bot commented Sep 24, 2013

Critic review: https://critic.hoppipolla.co.uk/r/330

This is an external review system which you may optionally use for the code review of your pull request.

Show outdated Hide outdated orientation-event/DeviceMotion/free-fall.html
x = gravity.x;
// Y : angle par rapport a y
y = gravity.y;
// Z : acceleromètre (de base : -9.81)

This comment has been minimized.

@tobie

tobie Sep 24, 2013

Contributor

In French, really?

@tobie

tobie Sep 24, 2013

Contributor

In French, really?

Show outdated Hide outdated orientation-event/DeviceMotion/free-fall.html
function init(){
if (window.DeviceMotionEvent) {
window.addEventListener('devicemotion', DeviceMotionHandler, false);
alert("Launch Test");

This comment has been minimized.

@tobie

tobie Sep 24, 2013

Contributor

This instruction is unclear.

@tobie

tobie Sep 24, 2013

Contributor

This instruction is unclear.

@tobie

This comment has been minimized.

Show comment
Hide comment
@tobie

tobie Sep 24, 2013

Contributor

It seems most of these tests are manual and should be marked as such (-manual file suffix.)

Contributor

tobie commented Sep 24, 2013

It seems most of these tests are manual and should be marked as such (-manual file suffix.)

Show outdated Hide outdated orientation-event/DeviceMotion/screen-upmost.html
<script src="http://w3c-test.org/resources/testharness.js"></script>
<script src="http://w3c-test.org/resources/testharnessreport.js"></script>
<script src="http://w3c-test.org/resources/WebIDLParser.js"></script>
<script src="http://w3c-test.org/resources/idlharness.js"></script>

This comment has been minimized.

@tobie

tobie Sep 24, 2013

Contributor

Don't think idlharness or WebIDLParser are necessary here.

@tobie

tobie Sep 24, 2013

Contributor

Don't think idlharness or WebIDLParser are necessary here.

Show outdated Hide outdated orientation-event/DeviceMotion/t022.html
ewin = null;
window.addEventListener('devicemotion', function(e) {etype = e.type; ewin = this;}, false);
setTimeout("testing()", 200);

This comment has been minimized.

@tobie

tobie Sep 24, 2013

Contributor

This is terribly ugly (relies on eval + globals for state).

The timeout is also very brittle.

We should seek a better option here, maybe:

var t1 = async_test("The corresponding event must be of type DeviceMotionEvent");
var t2 = async_test("The corresponding event must fire on the window object");
var run = false;
window.addEventListener('devicemotion', function(e) {
    if (!run) {
        run = true;
        var _this = this;
        t1.step(function() { assert_equals(e.type, "devicemotion"); });
        t1.done();
        t2.step(function() { assert_equals(_this, window); });
        t2.done();
    }
}, false);
@tobie

tobie Sep 24, 2013

Contributor

This is terribly ugly (relies on eval + globals for state).

The timeout is also very brittle.

We should seek a better option here, maybe:

var t1 = async_test("The corresponding event must be of type DeviceMotionEvent");
var t2 = async_test("The corresponding event must fire on the window object");
var run = false;
window.addEventListener('devicemotion', function(e) {
    if (!run) {
        run = true;
        var _this = this;
        t1.step(function() { assert_equals(e.type, "devicemotion"); });
        t1.done();
        t2.step(function() { assert_equals(_this, window); });
        t2.done();
    }
}, false);
Show outdated Hide outdated orientation-event/DeviceMotion/t026.html
}, false);
alert("Put your device on a horizontal surface with the screen upmost.");
tx = async_test("X angle must be set to zero");

This comment has been minimized.

@tobie

tobie Sep 24, 2013

Contributor

globals :(

@tobie

tobie Sep 24, 2013

Contributor

globals :(

Show outdated Hide outdated orientation-event/DeviceMotion/t026.html
</div>
<script>
setup({timeout:1500});

This comment has been minimized.

@tobie

tobie Sep 24, 2013

Contributor

No need to indicate short timeouts like this.

@tobie

tobie Sep 24, 2013

Contributor

No need to indicate short timeouts like this.

Show outdated Hide outdated orientation-event/pages/device_orientation_api.html
@@ -0,0 +1,167 @@
<!DOCTYPE html>

This comment has been minimized.

@tobie

tobie Sep 24, 2013

Contributor

You might want to turn parts of this into a README.

@tobie

tobie Sep 24, 2013

Contributor

You might want to turn parts of this into a README.

@zqzhang

This comment has been minimized.

Show comment
Hide comment
@zqzhang

zqzhang Sep 25, 2013

Contributor

@tobie, I just copied test files here and will review and update them soon.

Contributor

zqzhang commented Sep 25, 2013

@tobie, I just copied test files here and will review and update them soon.

@tobie

This comment has been minimized.

Show comment
Hide comment
@tobie

tobie Sep 25, 2013

Contributor

Oh, OK. In the future, please only send pull requests when the work is
ready to be reviewed. Thanks!

Contributor

tobie commented Sep 25, 2013

Oh, OK. In the future, please only send pull requests when the work is
ready to be reviewed. Thanks!

Zhiqiang Zhang added some commits Oct 14, 2013

Zhiqiang Zhang
Update test cases for DeviceOrientation Event
- Turn device_orientation_api.html and manifest.txt files into mainifest.txt and TODO.txt
- Remove t026.html as it has same checkpoints as screen-upmost.html, and merge values-null.html into screen-upmost.html
- Remove t030.html, t031.html, t032.html as they are incorrect in null attributes checking
- Rewrite other test cases
@darobin

This comment has been minimized.

Show comment
Hide comment
@darobin

darobin Jan 23, 2014

Contributor

May you please:

  • Rename the manual tests as -manual (most are)
  • Drop the manifest.txt
  • Remove all usage of user-scalable=no

Thanks!

Contributor

darobin commented Jan 23, 2014

May you please:

  • Rename the manual tests as -manual (most are)
  • Drop the manifest.txt
  • Remove all usage of user-scalable=no

Thanks!

Zhiqiang Zhang
Address @darobin comments:
- Rename the manual tests as -manual
- Drop the manifest.txt
- Remove all usage of user-scalable=no
@zqzhang

This comment has been minimized.

Show comment
Hide comment
@zqzhang

zqzhang Jan 24, 2014

Contributor

Hi @tobie and @darobin, these tests look good to me now after my review and update. Could you please review them? Many thanks.

Contributor

zqzhang commented Jan 24, 2014

Hi @tobie and @darobin, these tests look good to me now after my review and update. Could you please review them? Many thanks.

@sideshowbarker

This comment has been minimized.

Show comment
Hide comment
@sideshowbarker

sideshowbarker May 28, 2014

Member

This is waiting on review that @zqzhang asked for back in January. @tobie @darobin anybody?

Member

sideshowbarker commented May 28, 2014

This is waiting on review that @zqzhang asked for back in January. @tobie @darobin anybody?

cvrebert added a commit to whatwg/platform.html5.org that referenced this pull request Sep 15, 2015

Show outdated Hide outdated orientation-event/free-fall-manual.html
</head>
<body>
<p>Free fall the device to run the test, with the screen horizontal and upmost.</p>
<div id="log"></div>

This comment has been minimized.

@Honry

Honry May 23, 2016

Contributor

Indent not consistent.

@Honry

Honry May 23, 2016

Contributor

Indent not consistent.

This comment has been minimized.

@Honry

Honry May 23, 2016

Contributor

Please fix all indent issue in other files.

@Honry

Honry May 23, 2016

Contributor

Please fix all indent issue in other files.

Show outdated Hide outdated orientation-event/horizontal-surface-manual.html
}
}, false);
alert("Put the device on a horizontal surface.");

This comment has been minimized.

@Honry

Honry May 23, 2016

Contributor

Better to convert this hint to a text tag.

@Honry

Honry May 23, 2016

Contributor

Better to convert this hint to a text tag.

Show outdated Hide outdated orientation-event/horizontal-surface-manual.html
run = true;
gamma = e.gamma; // Gamma : angle par rapport a x
beta = e.beta; // Beta : angle par rapport a y
alpha = e.alpha; // Alpha : orientation (N-S-E-O)

This comment has been minimized.

@Honry

Honry May 23, 2016

Contributor

alpha in this test is unused. Need an assertion for it.

@Honry

Honry May 23, 2016

Contributor

alpha in this test is unused. Need an assertion for it.

Zhiqiang Zhang
Address @Honry comments
- Indent consistently using spaces
- Put user interaction instructions into a paragraph
- Remove unreferenced variable
@zqzhang

This comment has been minimized.

Show comment
Hide comment
@zqzhang

zqzhang Jun 13, 2016

Contributor

@Honry thanks for the review. Your comments shall be addressed. Please take another look, thanks.

Contributor

zqzhang commented Jun 13, 2016

@Honry thanks for the review. Your comments shall be addressed. Please take another look, thanks.

@Honry

This comment has been minimized.

Show comment
Hide comment
@Honry

Honry Jun 13, 2016

Contributor

LGTM

Contributor

Honry commented Jun 13, 2016

LGTM

@zqzhang zqzhang merged commit 7b96cc0 into web-platform-tests:master Jun 13, 2016

1 check passed

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

@zqzhang zqzhang deleted the zqzhang:submission/zqzhang/orientation-event branch Jun 13, 2016

arronei added a commit to arronei/web-platform-tests that referenced this pull request Jun 14, 2016

Import test cases from DVCS for Device Orientation Event (#350)
* Import test cases from DVCS for Device Orientation Event

https://dvcs.w3.org/hg/geo/rev/5ee2a7297634

* Update test cases for DeviceOrientation Event

- Turn device_orientation_api.html and manifest.txt files into mainifest.txt and TODO.txt
- Remove t026.html as it has same checkpoints as screen-upmost.html, and merge values-null.html into screen-upmost.html
- Remove t030.html, t031.html, t032.html as they are incorrect in null attributes checking
- Rewrite other test cases

* Remove http://w3c-test.org from test files.

* Address @darobin comments:

- Rename the manual tests as -manual
- Drop the manifest.txt
- Remove all usage of user-scalable=no

* Use WebIDLParser.js

* Address @Honry comments

- Indent consistently using spaces
- Put user interaction instructions into a paragraph
- Remove unreferenced variable

* Remove trailing whitespace

* Remove TODO as tests shall follow the latest spec at

https://w3c.github.io/deviceorientation/spec-source-orientation.html

ivanzr added a commit to ivanzr/web-platform-tests that referenced this pull request Jun 29, 2016

Import test cases from DVCS for Device Orientation Event (#350)
* Import test cases from DVCS for Device Orientation Event

https://dvcs.w3.org/hg/geo/rev/5ee2a7297634

* Update test cases for DeviceOrientation Event

- Turn device_orientation_api.html and manifest.txt files into mainifest.txt and TODO.txt
- Remove t026.html as it has same checkpoints as screen-upmost.html, and merge values-null.html into screen-upmost.html
- Remove t030.html, t031.html, t032.html as they are incorrect in null attributes checking
- Rewrite other test cases

* Remove http://w3c-test.org from test files.

* Address @darobin comments:

- Rename the manual tests as -manual
- Drop the manifest.txt
- Remove all usage of user-scalable=no

* Use WebIDLParser.js

* Address @Honry comments

- Indent consistently using spaces
- Put user interaction instructions into a paragraph
- Remove unreferenced variable

* Remove trailing whitespace

* Remove TODO as tests shall follow the latest spec at

https://w3c.github.io/deviceorientation/spec-source-orientation.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment