Closed Bug 855581 Opened 11 years ago Closed 11 years ago

Defect - New tab created if you receive "Leave Page" error and only a single tab is present

Categories

(Firefox for Metro Graveyard :: App Bar, defect, P1)

x86_64
Windows 8.1
defect

Tracking

(Not tracked)

VERIFIED FIXED
Firefox 23

People

(Reporter: kjozwiak, Assigned: TimAbraldes)

References

Details

(Whiteboard: feature=defect c=Tabs_app_bar u=metro_firefox_user p=1)

Attachments

(1 file)

When you only have a single tab opened and you receive the error message indicating that you are about to leave the website and the data entered will not be saved, a new tab will be created despite selecting "Stay on Page"

Steps to reproduce the issue:

1) Open Firefox Metro
2) Go to stackoverflow.com
3) Select a random question
4) Insert something random in the "Reply" field
5) Select the "X" on the tabs app bar (make sure that's your only tab currently opened). You will notice a new tab being created
6) Select "Stay on Page" (Notice the new Tab)

Current Behavior:

- When you only have a single tab opened and you receive the error message indicating your data will not be saved, a new tab is automatically created

Expected Behavior:

- A new tab should only be created if the user selects "Leave Page" and there is no other tabs currently opened
it5 consideration?
Flags: needinfo?(mmucci)
Moving to Iteration #5 for consideration as a Defect Story.
Blocks: metrov1it5
No longer blocks: metrov1triage
Flags: needinfo?(mmucci)
Priority: -- → P1
QA Contact: jbecerra
Whiteboard: feature=defect c=Tabs_app_bar u=metro_firefox_user p=0
This is probably related to the code for opening a new tab when the last tab is closed. We should make sure the tab is actually closing before executing that logic.
Whiteboard: feature=defect c=Tabs_app_bar u=metro_firefox_user p=0 → feature=defect c=Tabs_app_bar u=metro_firefox_user p=1
Assignee: nobody → tabraldes
Status: NEW → ASSIGNED
Blocks: metrov1it6
No longer blocks: metrov1it5
Attached patch Patch v1Splinter Review
This patch slightly rearranges some "close tab" logic in browser.js and browser-ui.js so that we only open a new tab if the last tab is actually closing.
Attachment #738280 - Flags: review?(fyan)
Comment on attachment 738280 [details] [diff] [review]
Patch v1

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

Yay for less setTimeouts!

Thanks for working on this. :)
Attachment #738280 - Flags: review?(fyan) → review+
https://hg.mozilla.org/mozilla-central/rev/49b7327cd49f
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
For Virgil to test and verify.
Flags: needinfo?(virgil.dicu)
Mozilla/5.0 (Windows NT 6.2; rv:23.0) Gecko/20130421 Firefox/23.0

Scenario in comment 0 is no longer reproducible.

Filed bug 864247 for case when back button is selected with the dialog open.

In addition:
-checked that both options of the dialog performed the desired action with one tab/multiple tabs open
-checked back/new tab buttons functionality with the prompt open
Status: RESOLVED → VERIFIED
Flags: needinfo?(virgil.dicu)
Verified for it8
By the way, this test could easily be automated.  Perhaps we should automate this test to reduce the load on our QA team?
OS: Windows 8 Metro → Windows 8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: