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

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

Issue 2792573002: Remove base::Value::CreateNullValue (Closed)
Patch Set: Rebase Created 3 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
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/capabilities.h" 5 #include "chrome/test/chromedriver/capabilities.h"
6 6
7 #include "base/memory/ptr_util.h"
7 #include "base/values.h" 8 #include "base/values.h"
8 #include "chrome/test/chromedriver/chrome/log.h" 9 #include "chrome/test/chromedriver/chrome/log.h"
9 #include "chrome/test/chromedriver/chrome/status.h" 10 #include "chrome/test/chromedriver/chrome/status.h"
10 #include "chrome/test/chromedriver/logging.h" 11 #include "chrome/test/chromedriver/logging.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 TEST(Switches, Empty) { 14 TEST(Switches, Empty) {
14 Switches switches; 15 Switches switches;
15 base::CommandLine cmd(base::CommandLine::NO_PROGRAM); 16 base::CommandLine cmd(base::CommandLine::NO_PROGRAM);
16 switches.AppendToCommandLine(&cmd); 17 switches.AppendToCommandLine(&cmd);
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 caps.Set("proxy", proxy.DeepCopy()); 298 caps.Set("proxy", proxy.DeepCopy());
298 Status status = capabilities.Parse(caps); 299 Status status = capabilities.Parse(caps);
299 ASSERT_FALSE(status.IsOk()); 300 ASSERT_FALSE(status.IsOk());
300 } 301 }
301 302
302 TEST(ParseCapabilities, IgnoreNullValueForManualProxy) { 303 TEST(ParseCapabilities, IgnoreNullValueForManualProxy) {
303 Capabilities capabilities; 304 Capabilities capabilities;
304 base::DictionaryValue proxy; 305 base::DictionaryValue proxy;
305 proxy.SetString("proxyType", "manual"); 306 proxy.SetString("proxyType", "manual");
306 proxy.SetString("ftpProxy", "localhost:9001"); 307 proxy.SetString("ftpProxy", "localhost:9001");
307 proxy.Set("sslProxy", base::Value::CreateNullValue()); 308 proxy.Set("sslProxy", base::MakeUnique<base::Value>());
308 proxy.Set("noProxy", base::Value::CreateNullValue()); 309 proxy.Set("noProxy", base::MakeUnique<base::Value>());
309 base::DictionaryValue caps; 310 base::DictionaryValue caps;
310 caps.Set("proxy", proxy.DeepCopy()); 311 caps.Set("proxy", proxy.DeepCopy());
311 Status status = capabilities.Parse(caps); 312 Status status = capabilities.Parse(caps);
312 ASSERT_TRUE(status.IsOk()); 313 ASSERT_TRUE(status.IsOk());
313 ASSERT_EQ(1u, capabilities.switches.GetSize()); 314 ASSERT_EQ(1u, capabilities.switches.GetSize());
314 ASSERT_TRUE(capabilities.switches.HasSwitch("proxy-server")); 315 ASSERT_TRUE(capabilities.switches.HasSwitch("proxy-server"));
315 ASSERT_EQ( 316 ASSERT_EQ(
316 "ftp=localhost:9001", 317 "ftp=localhost:9001",
317 capabilities.switches.GetSwitchValue("proxy-server")); 318 capabilities.switches.GetSwitchValue("proxy-server"));
318 } 319 }
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 base::DictionaryValue mobile_emulation; 556 base::DictionaryValue mobile_emulation;
556 mobile_emulation.SetString("deviceName", "Google Nexus 5"); 557 mobile_emulation.SetString("deviceName", "Google Nexus 5");
557 mobile_emulation.SetInteger("deviceMetrics.width", 360); 558 mobile_emulation.SetInteger("deviceMetrics.width", 360);
558 mobile_emulation.SetInteger("deviceMetrics.height", 640); 559 mobile_emulation.SetInteger("deviceMetrics.height", 640);
559 mobile_emulation.SetDouble("deviceMetrics.pixelRatio", 3.0); 560 mobile_emulation.SetDouble("deviceMetrics.pixelRatio", 3.0);
560 base::DictionaryValue caps; 561 base::DictionaryValue caps;
561 caps.Set("chromeOptions.mobileEmulation", mobile_emulation.DeepCopy()); 562 caps.Set("chromeOptions.mobileEmulation", mobile_emulation.DeepCopy());
562 Status status = capabilities.Parse(caps); 563 Status status = capabilities.Parse(caps);
563 ASSERT_FALSE(status.IsOk()); 564 ASSERT_FALSE(status.IsOk());
564 } 565 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/supervised_user_internals_message_handler.cc ('k') | chrome/test/chromedriver/chrome/web_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698