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

Side by Side Diff: chrome/browser/extensions/api/messaging/native_messaging_host_manifest_unittest.cc

Issue 2314363002: extensions: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Comment addressed Created 4 years, 3 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/browser/extensions/api/messaging/native_messaging_host_manifest .h" 5 #include "chrome/browser/extensions/api/messaging/native_messaging_host_manifest .h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/json/string_escape.h" 10 #include "base/json/string_escape.h"
(...skipping 10 matching lines...) Expand all
21 #else 21 #else
22 const char kTestHostPath[] = "/usr/bin/host"; 22 const char kTestHostPath[] = "/usr/bin/host";
23 #endif 23 #endif
24 const char kTestOrigin[] = 24 const char kTestOrigin[] =
25 "chrome-extension://knldjmfmopnpolahpmmgbagdohdnhkik/"; 25 "chrome-extension://knldjmfmopnpolahpmmgbagdohdnhkik/";
26 26
27 class NativeMessagingHostManifestTest : public ::testing::Test { 27 class NativeMessagingHostManifestTest : public ::testing::Test {
28 public: 28 public:
29 void SetUp() override { 29 void SetUp() override {
30 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 30 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
31 manifest_path_ = temp_dir_.path().AppendASCII("test.json"); 31 manifest_path_ = temp_dir_.GetPath().AppendASCII("test.json");
32 } 32 }
33 33
34 protected: 34 protected:
35 bool WriteManifest(const std::string& name, 35 bool WriteManifest(const std::string& name,
36 const std::string& path, 36 const std::string& path,
37 const std::string& origin) { 37 const std::string& origin) {
38 return WriteManifest("{" 38 return WriteManifest("{"
39 " \"name\": \"" + name + "\"," 39 " \"name\": \"" + name + "\","
40 " \"description\": \"Native Messaging Test\"," 40 " \"description\": \"Native Messaging Test\","
41 " \"path\": " + base::GetQuotedJSONString(path) + "," 41 " \"path\": " + base::GetQuotedJSONString(path) + ","
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 "chrome-extension://*/")); 107 "chrome-extension://*/"));
108 108
109 std::string error_message; 109 std::string error_message;
110 std::unique_ptr<NativeMessagingHostManifest> manifest = 110 std::unique_ptr<NativeMessagingHostManifest> manifest =
111 NativeMessagingHostManifest::Load(manifest_path_, &error_message); 111 NativeMessagingHostManifest::Load(manifest_path_, &error_message);
112 ASSERT_FALSE(manifest); 112 ASSERT_FALSE(manifest);
113 EXPECT_FALSE(error_message.empty()); 113 EXPECT_FALSE(error_message.empty());
114 } 114 }
115 115
116 } // namespace extensions 116 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698