This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Reactivate HTML Menu unit tests as part of the test suite #5290
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
assigned redmunds
Sep 23, 2013
@@ -476,8 +476,7 @@ define(function (require, exports, module) { | |||
waitsForDone(promise, "dismiss dialog"); | |||
} | |||
|
|||
|
|||
function createTestWindowAndRun(spec, callback) { | |||
function _createTestWindowAndRun(spec, hasNativeMenus, callback) { |
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.
To keep API simpler, make these changes:
- Keep only a single API call with original name:
createTestWindowAndRun
- Add an optional (3rd) parameter something like:
function createTestWindowAndRun(spec, callback, options)
. - New parameter is an Object (not a boolean), so new options can be added without adding any new params.
- Since new parameter is optional, then existing calls will not need to be updated. It only needs to be specified on new calls. If
options
object oroptions.hasNativeMenus
is not specified, default isbrackets.nativeMenus
.
Done with review. This looks pretty good. Just some API cleanup. |
@redmunds, API changes made. |
Edited description to remove new API functions since they are no longer part of the PR. |
global.brackets.nativeMenus = (params.get("hasNativeMenus") === "true"); | ||
} else { | ||
global.brackets.nativeMenus = (!global.brackets.inBrowser && (global.brackets.platform !== "linux")); | ||
} | ||
|
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 form is simpler, and it also checks for null
and empty string:
if (params.get("hasNativeMenus")) {
global.brackets.nativeMenus = (params.get("hasNativeMenus") === "true");
} else {
global.brackets.nativeMenus = (!global.brackets.inBrowser && (global.brackets.platform !== "linux"));
}
Also, how expensive is the call to params.get("hasNativeMenus")
? Should it be stored in a var
so it's not called twice?
Second review complete. |
@redmunds, code updated. |
Looks good. Merging. |
redmunds
added a commit
that referenced
this pull request
Sep 26, 2013
Reactivate HTML Menu unit tests as part of the test suite
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is from the following posting:
https://groups.google.com/forum/#!topic/brackets-dev/gJVZgXFq50o