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

Side by Side Diff: chrome/common/extensions/api/extension_api_unittest.cc

Issue 10834004: Correct const accessors in base/values.(h|cc) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reverting webdriver:Command::parameters_ to const Created 8 years, 4 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/common/extensions/api/extension_api.cc ('k') | chrome/common/extensions/extension.cc » ('j') | 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) 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 "chrome/common/extensions/api/extension_api.h" 5 #include "chrome/common/extensions/api/extension_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 Feature* feature = api.GetFeature("test"); 414 Feature* feature = api.GetFeature("test");
415 EXPECT_EQ(test_data[i].expect_success, feature != NULL) << i; 415 EXPECT_EQ(test_data[i].expect_success, feature != NULL) << i;
416 } 416 }
417 } 417 }
418 418
419 static void GetDictionaryFromList(const DictionaryValue* schema, 419 static void GetDictionaryFromList(const DictionaryValue* schema,
420 const std::string& list_name, 420 const std::string& list_name,
421 const int list_index, 421 const int list_index,
422 DictionaryValue** out) { 422 DictionaryValue** out) {
423 ListValue* list; 423 const ListValue* list;
424 EXPECT_TRUE(schema->GetList(list_name, &list)); 424 EXPECT_TRUE(schema->GetList(list_name, &list));
425 EXPECT_TRUE(list->GetDictionary(list_index, out)); 425 EXPECT_TRUE(list->GetDictionary(list_index, out));
426 } 426 }
427 427
428 TEST(ExtensionAPI, TypesHaveNamespace) { 428 TEST(ExtensionAPI, TypesHaveNamespace) {
429 FilePath manifest_path; 429 FilePath manifest_path;
430 PathService::Get(chrome::DIR_TEST_DATA, &manifest_path); 430 PathService::Get(chrome::DIR_TEST_DATA, &manifest_path);
431 manifest_path = manifest_path.AppendASCII("extensions") 431 manifest_path = manifest_path.AppendASCII("extensions")
432 .AppendASCII("extension_api_unittest") 432 .AppendASCII("extension_api_unittest")
433 .AppendASCII("types_have_namespace.json"); 433 .AppendASCII("types_have_namespace.json");
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 GetDictionaryFromList(dict, "parameters", 0, &sub_dict); 480 GetDictionaryFromList(dict, "parameters", 0, &sub_dict);
481 EXPECT_TRUE(sub_dict->GetString("$ref", &type)); 481 EXPECT_TRUE(sub_dict->GetString("$ref", &type));
482 EXPECT_EQ("test.foo.TestType", type); 482 EXPECT_EQ("test.foo.TestType", type);
483 GetDictionaryFromList(dict, "parameters", 1, &sub_dict); 483 GetDictionaryFromList(dict, "parameters", 1, &sub_dict);
484 EXPECT_TRUE(sub_dict->GetString("$ref", &type)); 484 EXPECT_TRUE(sub_dict->GetString("$ref", &type));
485 EXPECT_EQ("fully.qualified.Type", type); 485 EXPECT_EQ("fully.qualified.Type", type);
486 } 486 }
487 487
488 } // namespace 488 } // namespace
489 } // namespace extensions 489 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/extension_api.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698