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

Unified Diff: chrome/test/remoting/page_load_notification_observer.cc

Issue 771003002: Add support for deferring app initialization when testing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years 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/test/remoting/page_load_notification_observer.cc
diff --git a/chrome/test/remoting/page_load_notification_observer.cc b/chrome/test/remoting/page_load_notification_observer.cc
index 4898680bc8332bd83f61c42421268e0033a509c8..d83200be9246ffb5909f8318679785c3afd3bcd8 100644
--- a/chrome/test/remoting/page_load_notification_observer.cc
+++ b/chrome/test/remoting/page_load_notification_observer.cc
@@ -15,7 +15,8 @@ PageLoadNotificationObserver::PageLoadNotificationObserver(const GURL& target)
content::NOTIFICATION_LOAD_STOP,
base::Bind(&PageLoadNotificationObserver::IsTargetLoaded,
base::Unretained(this))),
- target_(target) {
+ target_(target),
+ ignore_url_parameters_(false) {
}
PageLoadNotificationObserver::~PageLoadNotificationObserver() {}
@@ -23,7 +24,15 @@ PageLoadNotificationObserver::~PageLoadNotificationObserver() {}
bool PageLoadNotificationObserver::IsTargetLoaded() {
content::NavigationController* controller =
content::Source<content::NavigationController>(source()).ptr();
- return controller->GetWebContents()->GetURL() == target_;
+ GURL current_url = controller->GetWebContents()->GetURL();
+ if (ignore_url_parameters_) {
+ GURL::Replacements strip_query;
+ strip_query.ClearQuery();
+ return current_url.ReplaceComponents(strip_query) ==
+ target_.ReplaceComponents(strip_query);
+ } else {
+ return current_url == target_;
+ }
}
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698