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

Unified Diff: chrome/test/chromedriver/chrome/browser_info.h

Issue 605143002: [chromedriver] Accept git hashes in blink version strings from devtools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot to git add new files Created 6 years, 3 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/test/chromedriver/chrome/browser_info.h
diff --git a/chrome/test/chromedriver/chrome/browser_info.h b/chrome/test/chromedriver/chrome/browser_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..e6f161b36a1f704f21f364cff36e8562a0585ef7
--- /dev/null
+++ b/chrome/test/chromedriver/chrome/browser_info.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_TEST_CHROMEDRIVER_CHROME_BROWSER_INFO_H_
+#define CHROME_TEST_CHROMEDRIVER_CHROME_BROWSER_INFO_H_
+
+#include "chrome/test/chromedriver/chrome/status.h"
+
+// Content Shell and WebView have an empty product version and a fake user
+// agent. There's no way to detect the actual version, so unless specified we
+// assume it is tip of tree.
+static const int kToTBuildNo = 9999;
+
+// Similarly, if the Blink Revision isn't given then assume it is tip of tree.
+static const int kToTBlinkRevision = 999999;
+
+struct BrowserInfo {
+ BrowserInfo();
+ BrowserInfo(std::string browser_name_,
+ std::string browser_version_,
+ int build_no_,
+ int blink_revision_);
+
+ std::string browser_name;
+ std::string browser_version;
+ int build_no;
+ int blink_revision;
+};
+
+Status ParseBrowserInfo(const std::string& data,
+ BrowserInfo* browser_info);
+
+Status ParseBrowserString(const std::string& browser_string,
+ std::string* browser_name,
+ std::string* browser_version,
+ int* build_no);
+
+Status ParseBlinkVersionString(const std::string& blink_version,
+ int* blink_revision);
+
+bool IsGitHash(const std::string& revision);
+
+#endif // CHROME_TEST_CHROMEDRIVER_CHROME_BROWSER_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698