Bug 897131 - Refresh the urlbar text when the navbar is displayed. r=jwilde
authorJim Mathies <jmathies@mozilla.com>
Thu, 25 Jul 2013 19:25:14 -0500
changeset 140068 062d97d84821700ed49bebf9c53e99da63775db6
parent 140067 1cf7aa4b2626aa9228c857f6fd4b5de1bfec2aa7
child 140069 b855e94a55fa8218fa7d73a86c4de3604c6810fb
push id25013
push userryanvm@gmail.com
push dateFri, 26 Jul 2013 14:47:14 +0000
treeherdermozilla-central@52f9e8ffe111 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwilde
bugs897131
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 897131 - Refresh the urlbar text when the navbar is displayed. r=jwilde
browser/metro/base/content/ContextUI.js
browser/metro/base/tests/mochitest/browser_urlbar.js
--- a/browser/metro/base/content/ContextUI.js
+++ b/browser/metro/base/content/ContextUI.js
@@ -93,16 +93,17 @@ var ContextUI = {
   /*
    * Show the nav and tabs bar. Returns true if any non-visible UI
    * was shown. Fires context ui events.
    */
   displayNavUI: function () {
     let shown = false;
 
     if (!this.navbarVisible) {
+      BrowserUI.updateURI();
       this.displayNavbar();
       shown = true;
     }
 
     if (!this.tabbarVisible) {
       this.displayTabs();
       shown = true;
     }
--- a/browser/metro/base/tests/mochitest/browser_urlbar.js
+++ b/browser/metro/base/tests/mochitest/browser_urlbar.js
@@ -225,8 +225,38 @@ gTests.push({
     ok(!gEdit.isEditing, "tap search option: not in editing mode");
 
     let searchSubmission = gEngine.getSubmission(search, null);
     let trimmedSubmission = gEdit.trimValue(searchSubmission.uri.spec);
     is(gEdit.value, trimmedSubmission, "tap search option: search conducted");
   }
 });
 
+gTests.push({
+  desc: "bug 897131 - url bar update after content tap + edge swipe",
+  setUp: setUp,
+  tearDown: tearDown,
+  run: function testUrlbarTyping() {
+    let tab = yield addTab("about:mozilla");
+
+    sendElementTap(window, gEdit);
+    ok(gEdit.isEditing, "focus urlbar: in editing mode");
+    ok(!gEdit.popup.popupOpen, "focus urlbar: popup not open yet");
+
+    EventUtils.sendString("about:blank", window);
+    let opened = yield waitForCondition(() => gEdit.popup.popupOpen);
+    ok(opened, "type in urlbar: popup opens");
+    
+    sendElementTap(window, tab.browser);
+
+    let closed = yield waitForCondition(() => !gEdit.popup.popupOpen);
+    ok(closed, "autocomplete closed after tap on content");
+    ok(!ContextUI.navbarVisible, "navbar closed"); 
+
+    let event = document.createEvent("Events");
+    event.initEvent("MozEdgeUICompleted", true, false);
+    window.dispatchEvent(event);
+
+    ok(ContextUI.navbarVisible, "navbar visible"); 
+    is(gEdit.value, "about:mozilla", "url bar text refreshed");
+  }
+});
+