Settings API: add test for closed lock

RESOLVED FIXED in mozilla15

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: gwagner, Assigned: gwagner)

Tracking

unspecified
mozilla15
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 626163 [details] [diff] [review]
patch
Attachment #626163 - Flags: review?(jonas)
(Assignee)

Updated

5 years ago
Assignee: nobody → anygregor
Comment on attachment 626163 [details] [diff] [review]
patch

Review of attachment 626163 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/settings/SettingsManager.js
@@ +122,2 @@
>        throw Components.results.NS_ERROR_ABORT;
> +      return;

The return line won't get executed. The 'throw' call will end execution of the function. So just remove the return statement.

Same in all other changes in this file.

::: dom/settings/tests/test_settings_basics.html
@@ +481,5 @@
> +    var lockx = mozSettings.getLock();
> +    var cb = function() {
> +      var reqx = {};
> +      try {
> +        reqx = lockx.set(wifiNetworks0);

Add a ok(false, "should have thrown") test here

@@ +487,5 @@
> +        ok(true, "Caught Exception");
> +        next();
> +      }
> +      reqx.onsuccess = function () {
> +        ok(false, "Shouldn't get here");

instead of doing this, set reqx to null in the beginning, and check that it's still null inside the catch-block before calling next().

@@ +489,5 @@
> +      }
> +      reqx.onsuccess = function () {
> +        ok(false, "Shouldn't get here");
> +      };
> +      reqx.onerror = onFailure;

And remove this line.

@@ +491,5 @@
> +        ok(false, "Shouldn't get here");
> +      };
> +      reqx.onerror = onFailure;
> +    }
> +    window.setTimeout(cb, 1);

Use SimpleTest.executeSoon()
Attachment #626163 - Flags: review?(jonas) → review+
(Assignee)

Updated

5 years ago
Summary: Settings API: don't return a request if the lock is closed → Settings API: add test for closed lock
(Assignee)

Comment 2

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/99878dcae029

Comment 3

5 years ago
https://hg.mozilla.org/mozilla-central/rev/99878dcae029
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.