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

Unified Diff: chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc

Issue 12389041: Require manifests for native messaging hosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
index 1a0f4d1b3da7e7309f9d790bf990ba55d5db90c2..f8ce3536b0e84cb2493ec5229a74d4c95958d9aa 100644
--- a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
@@ -33,6 +33,7 @@ using content::BrowserThread;
namespace {
+const char kTestHostId[] = "knldjmfmopnpolahpmmgbagdohdnhkik";
const char kTestMessage[] = "{\"text\": \"Hello.\"}";
base::FilePath GetTestDir() {
@@ -61,7 +62,8 @@ class FakeLauncher : public NativeProcessLauncher {
NULL, NULL);
}
- virtual void Launch(const std::string& native_host_name,
+ virtual void Launch(const GURL& origin,
+ const std::string& native_host_name,
LaunchedCallback callback) const OVERRIDE {
callback.Run(base::GetCurrentProcessHandle(), read_file_, write_file_);
}
@@ -151,7 +153,7 @@ TEST_F(NativeMessagingTest, SingleSendMessageRead) {
scoped_ptr<NativeProcessLauncher> launcher(
new FakeLauncher(temp_input_file, temp_output_file));
native_message_process_host_ = NativeMessageProcessHost::CreateWithLauncher(
- AsWeakPtr(), "empty_app.py", 0, launcher.Pass());
+ AsWeakPtr(), kTestHostId, "empty_app.py", 0, launcher.Pass());
ASSERT_TRUE(native_message_process_host_.get());
message_loop_.RunUntilIdle();
@@ -169,7 +171,7 @@ TEST_F(NativeMessagingTest, SingleSendMessageWrite) {
scoped_ptr<NativeProcessLauncher> launcher(
new FakeLauncher(temp_input_file, temp_output_file));
native_message_process_host_ = NativeMessageProcessHost::CreateWithLauncher(
- AsWeakPtr(), "empty_app.py", 0, launcher.Pass());
+ AsWeakPtr(), kTestHostId, "empty_app.py", 0, launcher.Pass());
ASSERT_TRUE(native_message_process_host_.get());
message_loop_.RunUntilIdle();
@@ -193,7 +195,7 @@ TEST_F(NativeMessagingTest, SingleSendMessageWrite) {
// it recieved.
TEST_F(NativeMessagingTest, DISABLED_EchoConnect) {
native_message_process_host_ = NativeMessageProcessHost::Create(
- AsWeakPtr(), "empty_app.py", 0);
+ AsWeakPtr(), kTestHostId, "empty_app.py", 0);
ASSERT_TRUE(native_message_process_host_.get());
message_loop_.RunUntilIdle();

Powered by Google App Engine
This is Rietveld 408576698