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

Unified Diff: chrome/test/chromedriver/chrome/chrome_impl.cc

Issue 148283009: Ignore generated background windows in GetWebViewIds for affected builds on M33 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove lower bound for ignoring generated background pages Created 6 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome/chrome_impl.cc
diff --git a/chrome/test/chromedriver/chrome/chrome_impl.cc b/chrome/test/chromedriver/chrome/chrome_impl.cc
index f293899e15b419b39b44f2916581c08244107845..1bdb4c616814c0c44da9024ef677a094a1ef02ee 100644
--- a/chrome/test/chromedriver/chrome/chrome_impl.cc
+++ b/chrome/test/chromedriver/chrome/chrome_impl.cc
@@ -4,6 +4,8 @@
#include "chrome/test/chromedriver/chrome/chrome_impl.h"
+#include <stdio.h>
+
#include "chrome/test/chromedriver/chrome/devtools_client.h"
#include "chrome/test/chromedriver/chrome/devtools_event_listener.h"
#include "chrome/test/chromedriver/chrome/devtools_http_client.h"
@@ -56,7 +58,16 @@ Status ChromeImpl::GetWebViewIds(std::list<std::string>* web_view_ids) {
// Check for newly-opened web views.
for (size_t i = 0; i < views_info.GetSize(); ++i) {
const WebViewInfo& view = views_info.Get(i);
- if (view.type != WebViewInfo::kPage)
+ if (view.type != WebViewInfo::kPage && view.type != WebViewInfo::kApp)
+ continue;
+
+ // Workaround to ignore generated background pages that are
+ // being returned as active windows for some builds of Chrome.
+ // TODO(bustamante): Once Chrome builds < 1755 are no longer
+ // supported this check can be removed.
+ int kBuildNumber = GetBuildNo();
+ if (kBuildNumber < 1755 && view.type == WebViewInfo::kApp &&
+ view.url.find("_generated_background_page") != std::string::npos)
continue;
bool found = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698