This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 971
Ensure tabs are not created in hidden window and correct window is focused #13866
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
…cused Fix #13859 Fix #13860 Fix #13865 Makes sure tabs are created in a shown window, or creates a new window, that the window is focused, and if the shown window is minimized, then that window is restored. Fixes for the following scenarios...: - There are no windows open - There are only minimized windows open ...For the following actions: - Brave is default browser and link clicked in another application - macOS dock icon is clicked - 'Brave' menu actions such as 'New Tab' or 'About Brave' Test plan: Browser must be set as default. If testing from source, the best way is to create a build `CHANNEL=dev npm run build-package`, run that, and set it as default. - Click URL link in external application - Ensure that tab opens in an active window, and the window is focused with the following scenarios: - 1 window open - 2+ windows open - 0 windows open - 1 minimized window open - 1 minimized window open and 1 non-minimized window open - Application exited - macOS: click dock icon, ensure window is focused or created: - 1 window open - 2+ windows open - 0 windows open - 1 minimized window open - 1 minimized window open and 1 non-minimized Even though the reported issues were macOS only, this test plan should be carried out on other platforms to ensure no regressions.
Codecov Report
@@ Coverage Diff @@
## master #13866 +/- ##
==========================================
- Coverage 56.63% 56.56% -0.07%
==========================================
Files 283 283
Lines 28848 28885 +37
Branches 4784 4786 +2
==========================================
+ Hits 16338 16339 +1
- Misses 12510 12546 +36
|
NejcZdovc
approved these changes
Apr 19, 2018
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.
++ test plan is working and code looks good to me
NejcZdovc
added a commit
that referenced
this pull request
Apr 19, 2018
Ensure tabs are not created in hidden window and correct window is focused
NejcZdovc
added a commit
that referenced
this pull request
Apr 19, 2018
Ensure tabs are not created in hidden window and correct window is focused
master 622ef4b @petemill I didn't merge into 0.22.x-c66 because there is a conflict and it looks like that some code doesn't exists that was added here #13749 which is targeted for 0.22 v3. What should we do here? Push it back into v3 or will work correctly without this PR? |
Thanks for the merge @NejcZdovc. #13749 will be uplifted to 0.22.x-c66 along with this one. I can do those cherry-picks for that branch. |
petemill
pushed a commit
that referenced
this pull request
Apr 19, 2018
Ensure tabs are not created in hidden window and correct window is focused
0.22.x-c66 1339f92 |
This was referenced Apr 20, 2018
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.
Fix #13859
Fix #13860
Fix #13865
Makes sure tabs are created in a shown window, or creates a new window, that the window is focused, and if the shown window is minimized, then that window is restored.
Fixes for the following scenarios...
...with the following actions:
About the code
cmdLine.js
with store action: notably the feature ofCREATE_TAB_REQUESTED
which will create a window for the tab if it does not exist. That was introduced recently for a very similar issue (with menu items) in Menu items which need a window will create / show one if needed #13749.FOCUS_OR_CREATE_MENU
) for when we want to focus any existing window, or create a new one if it does not exist (when the macOS dock icon is clicked and the app receives theactivate
event).getActiveWindow
to return a minimized window if there are no un-minimized windows. The risk here should be minimal since this api method is only used by these two actions (menu items, cli URLs, and URLs from external applications).Test plan:
Browser must be set as default. If testing from source, the best way is to create a build
CHANNEL=dev npm run build-package
, run that, and set it as default.- 1 window open
- 2+ windows open
- 0 windows open
- 1 minimized window open
- 1 minimized window open and 1 non-minimized window open
- Application exited
- 1 window open
- 2+ windows open
- 0 windows open
- 1 minimized window open
- 1 minimized window open and 1 non-minimized
Even though the reported issues were macOS only, this test plan should be carried out on other platforms to ensure no regressions.
Submitter Checklist:
git rebase -i
to squash commits (if needed).Reviewer Checklist:
Tests