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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
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 <string> 5 #include <string>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/test/chromedriver/chrome/devtools_http_client.h" 9 #include "chrome/test/chromedriver/chrome/devtools_http_client.h"
10 #include "chrome/test/chromedriver/chrome/status.h" 10 #include "chrome/test/chromedriver/chrome/status.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 TEST(ParseWebViewsInfo, WithoutDebuggerUrl) { 59 TEST(ParseWebViewsInfo, WithoutDebuggerUrl) {
60 WebViewsInfo views_info; 60 WebViewsInfo views_info;
61 Status status = internal::ParseWebViewsInfo( 61 Status status = internal::ParseWebViewsInfo(
62 "[{\"type\": \"page\", \"id\": \"1\", \"url\": \"http://page1\"}]", 62 "[{\"type\": \"page\", \"id\": \"1\", \"url\": \"http://page1\"}]",
63 &views_info); 63 &views_info);
64 ASSERT_TRUE(status.IsOk()); 64 ASSERT_TRUE(status.IsOk());
65 ASSERT_EQ(1u, views_info.GetSize()); 65 ASSERT_EQ(1u, views_info.GetSize());
66 ExpectEqual( 66 ExpectEqual(
67 WebViewInfo( 67 WebViewInfo("1", std::string(), "http://page1", WebViewInfo::kPage),
68 "1", "", "http://page1", WebViewInfo::kPage),
69 views_info.Get(0)); 68 views_info.Get(0));
70 } 69 }
71 70
72 namespace { 71 namespace {
73 72
74 void AssertFails(const std::string& data) { 73 void AssertFails(const std::string& data) {
75 WebViewsInfo views_info; 74 WebViewsInfo views_info;
76 Status status = internal::ParseWebViewsInfo(data, &views_info); 75 Status status = internal::ParseWebViewsInfo(data, &views_info);
77 ASSERT_FALSE(status.IsOk()); 76 ASSERT_FALSE(status.IsOk());
78 ASSERT_EQ(0u, views_info.GetSize()); 77 ASSERT_EQ(0u, views_info.GetSize());
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 AssertVersionFails("{}"); 146 AssertVersionFails("{}");
148 } 147 }
149 148
150 TEST(ParseVersionInfo, Valid) { 149 TEST(ParseVersionInfo, Valid) {
151 std::string version; 150 std::string version;
152 Status status = internal::ParseVersionInfo("{\"Browser\": \"1\"}", &version); 151 Status status = internal::ParseVersionInfo("{\"Browser\": \"1\"}", &version);
153 ASSERT_TRUE(status.IsOk()); 152 ASSERT_TRUE(status.IsOk());
154 ASSERT_EQ("1", version); 153 ASSERT_EQ("1", version);
155 } 154 }
156 155
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698