Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Unified Diff: chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc

Issue 1015463004: Consistent content placement method for dom-distiller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ios code Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/dom_distiller/content/distiller_page_web_contents_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc
diff --git a/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc b/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc
index 4ad5f69ee8bd2824bbb11d24508dacbfcef783d1..ea54253382f7c1bcce2ab8bfd12dbb5737cb3db9 100644
--- a/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc
+++ b/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc
@@ -32,8 +32,10 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test_utils.h"
+#include "grit/components_strings.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/l10n/l10n_util.h"
namespace dom_distiller {
@@ -200,6 +202,29 @@ void DomDistillerViewerSourceBrowserTest::ViewSingleDistilledPage(
EXPECT_EQ(expected_mime_type, contents_after_nav->GetContentsMimeType());
}
+IN_PROC_BROWSER_TEST_F(DomDistillerViewerSourceBrowserTest,
+ TestBadUrlErrorPage) {
+ GURL url("chrome-distiller://bad");
+
+ // Navigate to a distiller URL.
+ ui_test_utils::NavigateToURL(browser(), url);
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+
+ // Wait for the page load to complete as the first page completes the root
+ // document.
+ content::WaitForLoadStop(contents);
+
+ ASSERT_TRUE(contents != NULL);
+ EXPECT_EQ(url, contents->GetLastCommittedURL());
+
+ std::string result;
+ EXPECT_TRUE(content::ExecuteScriptAndExtractString(
+ contents, kGetContent , &result));
+ EXPECT_THAT(result, HasSubstr(l10n_util::GetStringUTF8(
+ IDS_DOM_DISTILLER_VIEWER_FAILED_TO_FIND_ARTICLE_CONTENT)));
+}
+
// The DomDistillerViewerSource renders untrusted content, so ensure no bindings
// are enabled when the CSS resource is loaded. This CSS might be bundle with
// Chrome or provided by an extension.
« no previous file with comments | « no previous file | components/dom_distiller/content/distiller_page_web_contents_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698