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

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

Issue 1130703003: Show template before distiller finishes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ios-superclass
Patch Set: Rebase and add file to gypi Created 5 years, 7 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
Index: chrome/browser/dom_distiller/tab_utils_browsertest.cc
diff --git a/chrome/browser/dom_distiller/tab_utils_browsertest.cc b/chrome/browser/dom_distiller/tab_utils_browsertest.cc
index 124aaaff0347520a4521ac3c6f5920a31c686340..019d712a4643a83b9635bf27cd80e09f4f56d770 100644
--- a/chrome/browser/dom_distiller/tab_utils_browsertest.cc
+++ b/chrome/browser/dom_distiller/tab_utils_browsertest.cc
@@ -22,6 +22,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test_utils.h"
+#include "content/public/test/test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -86,12 +87,15 @@ IN_PROC_BROWSER_TEST_F(DomDistillerTabUtilsBrowserTest,
new_url_loaded_runner.QuitClosure()));
new_url_loaded_runner.Run();
+ std::string page_title;
+ content::ExecuteScriptAndGetValue(after_web_contents->GetMainFrame(),
+ "document.title")->GetAsString(&page_title);
+
// Verify the new URL is showing distilled content in a new WebContents.
EXPECT_NE(initial_web_contents, after_web_contents);
EXPECT_TRUE(
after_web_contents->GetLastCommittedURL().SchemeIs(kDomDistillerScheme));
- EXPECT_EQ("Test Page Title",
- base::UTF16ToUTF8(after_web_contents->GetTitle()));
+ EXPECT_EQ("Test Page Title", page_title);
}
IN_PROC_BROWSER_TEST_F(DomDistillerTabUtilsBrowserTest,

Powered by Google App Engine
This is Rietveld 408576698