Closed
Bug 1190322
Opened 9 years ago
Closed 9 years ago
Test coverage for |extension| extension API
Categories
(WebExtensions :: Untriaged, defect)
WebExtensions
Untriaged
Tracking
(firefox48 fixed)
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: gkrizsanits, Assigned: bsilverberg)
References
Details
(Whiteboard: [testing] triaged)
Attachments
(1 file)
No description provided.
Comment 1•9 years ago
|
||
This is still missing coverage for:
* The |getViews| API method with any properties object at all, and in particular with |type| or |windowId| properties.
https://people.mozilla.org/~kmaglione/webextension-test-coverage/toolkit/components/extensions/ext-extension.js.html
Updated•9 years ago
|
Component: Extension Compatibility → WebExtensions
Product: Firefox → Toolkit
Updated•9 years ago
|
Flags: blocking-webextensions-
Updated•9 years ago
|
Flags: blocking-webextensions- → blocking-webextensions+
Updated•9 years ago
|
Assignee: nobody → bob.silverberg
Updated•9 years ago
|
Whiteboard: [testing] triaged
Assignee | ||
Updated•9 years ago
|
Iteration: --- → 48.3 - Apr 18
Assignee | ||
Comment 2•9 years ago
|
||
According to [1], this also now needs coverage for:
* The |inIncognitoContext| property.
[1] https://people.mozilla.org/~kmaglione/webextension-test-coverage/toolkit/components/extensions/ext-extension.js.html
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•9 years ago
|
||
Add coverage for:
* The |getViews| API method with a |type| property.
* The |getViews| API method with a |windowId| property.
* The |inIncognitoContext| property.
Review commit: https://reviewboard.mozilla.org/r/45019/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/45019/
Attachment #8739007 -
Flags: review?(kmaglione+bmo)
Assignee | ||
Comment 4•9 years ago
|
||
https://reviewboard.mozilla.org/r/45019/#review41523
::: toolkit/components/extensions/test/mochitest/test_ext_extension.html:50
(Diff revision 1)
> + yield extension.startup();
> + yield extension.awaitFinish("inIncognitoContext");
> + yield extension.unload();
> +});
> +
> +add_task(function* test_in_incognito_context_true() {
This is my attempt to write a test that would expect `inIncognitoContext` to be `true`. The test proceeds as expected, but `inIncognitoContext` is not `true` because the code is not running in a private window. I have a couple of questions about this:
1. What is the case in which we would expect `inIncognitoContext` to return `true`.
2. How can I create that scenario in the context of a test? I've tried opening private windows and tabs, but I haven't been able to get it to work. Is there a way to open a private window via the `window.open` command that I am using on line 89?
Comment 5•9 years ago
|
||
Comment on attachment 8739007 [details]
MozReview Request: Bug 1190322 - Test coverage for |extension| extension API, r?kmag
https://reviewboard.mozilla.org/r/45019/#review41601
Please file a different bug for the `isIncognitoContext` tests. The others look fine.
::: browser/components/extensions/test/browser/browser_ext_getViews.js:117
(Diff revision 1)
> function* openTab(winId) {
> extension.sendMessage("background-open-tab", winId);
> yield extension.awaitMessage("tab-ready");
> }
>
> - function* checkViews(kind, tabCount, popupCount) {
> + function* checkViews(kind, tabCount, popupCount, kindCount, windowId, windowCount = 0) {
Please add `undefined` as a default value for `windowId` to make it clear that it's optional.
Attachment #8739007 -
Flags: review?(kmaglione+bmo) → review+
Comment 6•9 years ago
|
||
(In reply to Bob Silverberg [:bsilverberg] from comment #4)
> 1. What is the case in which we would expect `inIncognitoContext` to return
> `true`.
That's a question without a clear answer. I'd expect it to return true for:
- Content scripts running in tabs in private windows.
- Web extension pages loaded into tabs in private windows.
- Web extension pages loaded into popups in private windows.
I'm not sure, though, which of those currently work, or what Chrome does for
any of them.
> 2. How can I create that scenario in the context of a test? I've tried
> opening private windows and tabs, but I haven't been able to get it to work.
> Is there a way to open a private window via the `window.open` command that I
> am using on line 89?
window.open({incognito: true});
Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8739007 [details]
MozReview Request: Bug 1190322 - Test coverage for |extension| extension API, r?kmag
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/45019/diff/1-2/
Assignee | ||
Comment 8•9 years ago
|
||
Assignee | ||
Comment 9•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 11•9 years ago
|
||
Comment on attachment 8739007 [details]
MozReview Request: Bug 1190322 - Test coverage for |extension| extension API, r?kmag
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/45019/diff/2-3/
Comment 13•9 years ago
|
||
Keywords: checkin-needed
Comment 14•9 years ago
|
||
bugherder landing |
Comment 15•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Updated•6 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•