-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix partial issues from #10198 #10962
Fix partial issues from #10198 #10962
Conversation
- `if (testRunner)` should be `if (window.testRunner)` - Use String to pass sensor object param to avoid undefined error
@pozdnyakov, @alexshalamov, PTAL. |
['accelerometer', 'gyroscope', | ||
'magnetometer', 'ambient-light-sensor'].forEach((entry) => { | ||
testRunner.setPermission(entry, 'granted', | ||
window.testRunner.setPermission(entry, 'granted', | ||
location.origin, location.origin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to reindent this line as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! Fixed.
@@ -201,10 +201,10 @@ var GenericSensorTest = (() => { | |||
if (testInternal.initialized) | |||
throw new Error('Call reset() before initialize().'); | |||
|
|||
if (testRunner) { // Grant sensor permissions for Chromium testrunner. | |||
if (window.testRunner) { // Grant sensor permissions for Chromium testrunner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if this sounds dumb, but isn't testRunner
the same as window.testRunner
here? Or do the Mojo JS files behave differently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This testRunner
is specific for Chromium testrunner, not sure if it is still useful in LayoutTests/external/wpt
, but for sure, it is undefined
in w-p-t runnner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e. tests will fail with Uncaught ReferenceError: testRunner is not defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't all the tests failing now? run_fp_tests_* and runGenericSensor* need to updated, right?
@foolip, most tests are still failing, for the reason, please see my comment at #10906 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look fine to me, even if there might be additional work left. @foolip?
@Honry, even if the tests are already failing, won't these changes make them further from passing? If they're already passing in Chromium, could you try making the changes in a Chromium CL and see if they stay passing? |
@foolip AFAICS, this PR should get these tests closer, not further, to passing. Other directories which call those functions (e.g. |
Hmm, something is very strange, run_fp_tests_disabled and runGenericSensorTests already assumes a string argument, but some tests still pass interface objects. So yes, these tests are moving things in the right direction. (I assumed that the helpers weren't updated, in which case this made no sense.) |
if (testRunner)
should beif (window.testRunner)
This change is