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

Side by Side Diff: chrome/test/chromedriver/chrome/browser_info_unittest.cc

Issue 2731403008: Add headless chrome as an accepted browser string in chromedriver. (Closed)
Patch Set: Fix tests Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/test/chromedriver/chrome/browser_info.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/chromedriver/chrome/browser_info.h" 5 #include "chrome/test/chromedriver/chrome/browser_info.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace { 9 namespace {
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 Status status = 96 Status status =
97 ParseBrowserString(false, "Chrome/39.0.2171.59", &browser_info); 97 ParseBrowserString(false, "Chrome/39.0.2171.59", &browser_info);
98 ASSERT_TRUE(status.IsOk()); 98 ASSERT_TRUE(status.IsOk());
99 ASSERT_EQ("chrome", browser_info.browser_name); 99 ASSERT_EQ("chrome", browser_info.browser_name);
100 ASSERT_EQ("39.0.2171.59", browser_info.browser_version); 100 ASSERT_EQ("39.0.2171.59", browser_info.browser_version);
101 ASSERT_EQ(39, browser_info.major_version); 101 ASSERT_EQ(39, browser_info.major_version);
102 ASSERT_EQ(2171, browser_info.build_no); 102 ASSERT_EQ(2171, browser_info.build_no);
103 ASSERT_FALSE(browser_info.is_android); 103 ASSERT_FALSE(browser_info.is_android);
104 } 104 }
105 105
106 TEST(ParseBrowserString, HeadlessChrome) {
107 BrowserInfo browser_info;
108 Status status =
109 ParseBrowserString(false, "HeadlessChrome/39.0.2171.59", &browser_info);
110 ASSERT_TRUE(status.IsOk());
111 ASSERT_EQ("headless chrome", browser_info.browser_name);
112 ASSERT_EQ("39.0.2171.59", browser_info.browser_version);
113 ASSERT_EQ(39, browser_info.major_version);
114 ASSERT_EQ(2171, browser_info.build_no);
115 ASSERT_FALSE(browser_info.is_android);
116 }
117
106 TEST(ParseBlinkVersionString, GitHash) { 118 TEST(ParseBlinkVersionString, GitHash) {
107 int rev = -1; 119 int rev = -1;
108 Status status = ParseBlinkVersionString( 120 Status status = ParseBlinkVersionString(
109 "537.36 (@28f741cfcabffe68a9c12c4e7152569c906bd88f)", &rev); 121 "537.36 (@28f741cfcabffe68a9c12c4e7152569c906bd88f)", &rev);
110 ASSERT_TRUE(status.IsOk()); 122 ASSERT_TRUE(status.IsOk());
111 ASSERT_EQ(-1, rev); 123 ASSERT_EQ(-1, rev);
112 } 124 }
113 125
114 TEST(ParseBlinkVersionString, SvnRevision) { 126 TEST(ParseBlinkVersionString, SvnRevision) {
115 int blink_revision = -1; 127 int blink_revision = -1;
(...skipping 10 matching lines...) Expand all
126 ASSERT_TRUE(IsGitHash("1493aa5")); 138 ASSERT_TRUE(IsGitHash("1493aa5"));
127 } 139 }
128 140
129 TEST(IsGitHash, GitHashWithUpperCaseCharacters) { 141 TEST(IsGitHash, GitHashWithUpperCaseCharacters) {
130 ASSERT_TRUE(IsGitHash("28F741CFCABFFE68A9C12C4E7152569C906BD88F")); 142 ASSERT_TRUE(IsGitHash("28F741CFCABFFE68A9C12C4E7152569C906BD88F"));
131 } 143 }
132 144
133 TEST(IsGitHash, SvnRevision) { 145 TEST(IsGitHash, SvnRevision) {
134 ASSERT_FALSE(IsGitHash("159105")); 146 ASSERT_FALSE(IsGitHash("159105"));
135 } 147 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome/browser_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698