Bug 1139678 - (Part 2) Update non-reader-able test URL in browser_readerMode.js. r=Gijs a=readinglist
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 17 Mar 2015 09:23:19 -0700
changeset 248431 ead131a382fe5b74190dce9a0fca78c88563d192
parent 248430 afede426f944bd4961a49ad09750f4fbca69a343
child 248432 b7c0318cd5b0ac571011aca8e6dfa1ad2298a52a
push id7837
push userjwein@mozilla.com
push dateFri, 27 Mar 2015 00:27:16 +0000
treeherdermozilla-aurora@cb0db44ce60e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, readinglist
bugs1139678
milestone38.0a2
Bug 1139678 - (Part 2) Update non-reader-able test URL in browser_readerMode.js. r=Gijs a=readinglist
browser/base/content/content.js
browser/base/content/test/general/browser_readerMode.js
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -488,17 +488,17 @@ let AboutReaderListener = {
     addEventListener("pageshow", this, false);
     addEventListener("pagehide", this, false);
     addMessageListener("Reader:ParseDocument", this);
   },
 
   receiveMessage: function(message) {
     switch (message.name) {
       case "Reader:ParseDocument":
-        this._articlePromise = ReaderMode.parseDocument(content.document);
+        this._articlePromise = ReaderMode.parseDocument(content.document).catch(Cu.reportError);
         content.document.location = "about:reader?url=" + encodeURIComponent(message.data.url);
         break;
     }
   },
 
   get isAboutReader() {
     return content.document.documentURI.startsWith("about:reader");
   },
--- a/browser/base/content/test/general/browser_readerMode.js
+++ b/browser/base/content/test/general/browser_readerMode.js
@@ -66,17 +66,17 @@ add_task(function* () {
     "The ReadingListUI should now indicate SideBar-ReadingList open.");
 
   readerButton.click();
   yield promiseTabLoadEvent(tab);
   is(gBrowser.selectedBrowser.currentURI.spec, url, "Original page loaded after clicking active reader mode button");
 
   // Load a new tab that is NOT reader-able.
   let newTab = gBrowser.selectedTab = gBrowser.addTab();
-  yield promiseTabLoadEvent(newTab, TEST_PATH + "download_page.html");
+  yield promiseTabLoadEvent(newTab, "about:robots");
   yield promiseWaitForCondition(() => readerButton.hidden);
   is_element_hidden(readerButton, "Reader mode button is not present on a non-reader-able page");
 
   // Switch back to the original tab to make sure reader mode button is still visible.
   gBrowser.removeCurrentTab();
   yield promiseWaitForCondition(() => !readerButton.hidden);
   is_element_visible(readerButton, "Reader mode button is present on a reader-able page");
 });