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

Unified Diff: chrome/browser/net/errorpage_browsertest.cc

Issue 2913733002: Add a browser test for access control for file: scheme (Closed)
Patch Set: Address comments Created 3 years, 6 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/net/errorpage_browsertest.cc
diff --git a/chrome/browser/net/errorpage_browsertest.cc b/chrome/browser/net/errorpage_browsertest.cc
index a328daa7a7dfc4324c4c843aba8d212e2036ee76..1f056b600a6cc820917787a5e340114aae0fc2e3 100644
--- a/chrome/browser/net/errorpage_browsertest.cc
+++ b/chrome/browser/net/errorpage_browsertest.cc
@@ -89,9 +89,10 @@ using net::URLRequestTestJob;
namespace {
-// Returns true if |text| is displayed on the page |browser| is currently
-// displaying. Uses "innerText", so will miss hidden text, and whitespace
-// space handling may be weird.
+// Searches for first node containing |text|, and if it finds one, searches
+// through all ancestors seeing if any of them is of class "hidden". Since it
+// relies on the hidden class used by network error pages, not suitable for
+// general use.
bool WARN_UNUSED_RESULT IsDisplayingText(Browser* browser,
const std::string& text) {
// clang-format off

Powered by Google App Engine
This is Rietveld 408576698