| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/base64.h" | 5 #include "base/base64.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 options->SetInteger("driver", kInfoLogLevel); | 273 options->SetInteger("driver", kInfoLogLevel); |
| 274 ASSERT_TRUE(parser.Parse()); | 274 ASSERT_TRUE(parser.Parse()); |
| 275 } | 275 } |
| 276 | 276 |
| 277 TEST(CapabilitiesParser, ExcludeSwitches) { | 277 TEST(CapabilitiesParser, ExcludeSwitches) { |
| 278 DictionaryValue dict; | 278 DictionaryValue dict; |
| 279 DictionaryValue* options = new DictionaryValue(); | 279 DictionaryValue* options = new DictionaryValue(); |
| 280 dict.Set("chromeOptions", options); | 280 dict.Set("chromeOptions", options); |
| 281 | 281 |
| 282 ListValue* switches = new ListValue(); | 282 ListValue* switches = new ListValue(); |
| 283 switches->Append(new base::StringValue(switches::kNoFirstRun)); | 283 switches->Append(new base::StringValue(switches::kSkipFirstRun)); |
| 284 switches->Append(new base::StringValue(switches::kDisableSync)); | 284 switches->Append(new base::StringValue(switches::kDisableSync)); |
| 285 switches->Append(new base::StringValue(switches::kDisableTranslate)); | 285 switches->Append(new base::StringValue(switches::kDisableTranslate)); |
| 286 options->Set("excludeSwitches", switches); | 286 options->Set("excludeSwitches", switches); |
| 287 | 287 |
| 288 Capabilities caps; | 288 Capabilities caps; |
| 289 CapabilitiesParser parser(&dict, base::FilePath(), Logger(), &caps); | 289 CapabilitiesParser parser(&dict, base::FilePath(), Logger(), &caps); |
| 290 ASSERT_FALSE(parser.Parse()); | 290 ASSERT_FALSE(parser.Parse()); |
| 291 | 291 |
| 292 const std::set<std::string>& rm_set = caps.exclude_switches; | 292 const std::set<std::string>& rm_set = caps.exclude_switches; |
| 293 EXPECT_EQ(static_cast<size_t>(3), rm_set.size()); | 293 EXPECT_EQ(static_cast<size_t>(3), rm_set.size()); |
| 294 ASSERT_TRUE(rm_set.find(switches::kNoFirstRun) != rm_set.end()); | 294 ASSERT_TRUE(rm_set.find(switches::kSkipFirstRun) != rm_set.end()); |
| 295 ASSERT_TRUE(rm_set.find(switches::kDisableSync) != rm_set.end()); | 295 ASSERT_TRUE(rm_set.find(switches::kDisableSync) != rm_set.end()); |
| 296 ASSERT_TRUE(rm_set.find(switches::kDisableTranslate) != rm_set.end()); | 296 ASSERT_TRUE(rm_set.find(switches::kDisableTranslate) != rm_set.end()); |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace webdriver | 299 } // namespace webdriver |
| OLD | NEW |