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

Side by Side Diff: chrome/browser/platform_util_unittest.cc

Issue 1394993004: Make ValueDeserializer::Deserialize return scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add todo about not failed trybot Created 5 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/platform_util.h" 5 #include "chrome/browser/platform_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 " \"version\": \"0\"," 85 " \"version\": \"0\","
86 " \"app\": { \"background\": { \"scripts\": [\"main.js\"] }}," 86 " \"app\": { \"background\": { \"scripts\": [\"main.js\"] }},"
87 " \"file_handlers\": {" 87 " \"file_handlers\": {"
88 " \"text\": {" 88 " \"text\": {"
89 " \"extensions\": [ \"txt\" ]," 89 " \"extensions\": [ \"txt\" ],"
90 " \"title\": \"Text\"" 90 " \"title\": \"Text\""
91 " }" 91 " }"
92 " }" 92 " }"
93 "}"; 93 "}";
94 JSONStringValueDeserializer json_string_deserializer(json_manifest); 94 JSONStringValueDeserializer json_string_deserializer(json_manifest);
95 scoped_ptr<base::Value> manifest( 95 scoped_ptr<base::Value> manifest =
96 json_string_deserializer.Deserialize(&error_code, &error)); 96 json_string_deserializer.Deserialize(&error_code, &error);
97 base::DictionaryValue* manifest_dictionary; 97 base::DictionaryValue* manifest_dictionary;
98 98
99 manifest->GetAsDictionary(&manifest_dictionary); 99 manifest->GetAsDictionary(&manifest_dictionary);
100 ASSERT_TRUE(manifest_dictionary); 100 ASSERT_TRUE(manifest_dictionary);
101 101
102 scoped_refptr<extensions::Extension> extension = 102 scoped_refptr<extensions::Extension> extension =
103 extensions::Extension::Create( 103 extensions::Extension::Create(
104 test_directory.AppendASCII("invalid-extension"), 104 test_directory.AppendASCII("invalid-extension"),
105 extensions::Manifest::INVALID_LOCATION, *manifest_dictionary, 105 extensions::Manifest::INVALID_LOCATION, *manifest_dictionary,
106 extensions::Extension::NO_FLAGS, &error); 106 extensions::Extension::NO_FLAGS, &error);
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 TEST_F(PlatformUtilPosixTest, OpenFolderWithPosixSymlinks) { 283 TEST_F(PlatformUtilPosixTest, OpenFolderWithPosixSymlinks) {
284 EXPECT_EQ(OPEN_SUCCEEDED, CallOpenItem(symlink_to_folder_, OPEN_FOLDER)); 284 EXPECT_EQ(OPEN_SUCCEEDED, CallOpenItem(symlink_to_folder_, OPEN_FOLDER));
285 EXPECT_EQ(OPEN_FAILED_INVALID_TYPE, 285 EXPECT_EQ(OPEN_FAILED_INVALID_TYPE,
286 CallOpenItem(symlink_to_file_, OPEN_FOLDER)); 286 CallOpenItem(symlink_to_file_, OPEN_FOLDER));
287 EXPECT_EQ(OPEN_FAILED_PATH_NOT_FOUND, 287 EXPECT_EQ(OPEN_FAILED_PATH_NOT_FOUND,
288 CallOpenItem(symlink_to_nowhere_, OPEN_FOLDER)); 288 CallOpenItem(symlink_to_nowhere_, OPEN_FOLDER));
289 } 289 }
290 #endif // OS_POSIX && !OS_CHROMEOS 290 #endif // OS_POSIX && !OS_CHROMEOS
291 291
292 } // namespace platform_util 292 } // namespace platform_util
OLDNEW
« no previous file with comments | « chrome/browser/extensions/user_script_listener_unittest.cc ('k') | chrome/browser/prefs/pref_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698