| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
| 15 #include "base/process_util.h" | 15 #include "base/process_util.h" |
| 16 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
| 17 #include "chrome/browser/extensions/api/messaging/native_message_process_host.h" | 17 #include "chrome/browser/extensions/api/messaging/native_message_process_host.h" |
| 18 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" | 18 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" |
| 19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/chrome_version_info.h" | 21 #include "chrome/common/chrome_version_info.h" |
| 22 #include "chrome/common/extensions/extension.h" |
| 22 #include "chrome/common/extensions/features/feature.h" | 23 #include "chrome/common/extensions/features/feature.h" |
| 23 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
| 24 #include "content/public/test/test_browser_thread.h" | 25 #include "content/public/test/test_browser_thread.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 27 |
| 27 using content::BrowserThread; | 28 using content::BrowserThread; |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 | 31 |
| 31 const char kTestMessage[] = "{\"text\": \"Hello.\"}"; | 32 const char kTestMessage[] = "{\"text\": \"Hello.\"}"; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 last_posted_message_); | 197 last_posted_message_); |
| 197 | 198 |
| 198 native_message_process_host_->Send("{\"foo\": \"bar\"}"); | 199 native_message_process_host_->Send("{\"foo\": \"bar\"}"); |
| 199 message_loop_.RunUntilIdle(); | 200 message_loop_.RunUntilIdle(); |
| 200 native_message_process_host_->ReadNowForTesting(); | 201 native_message_process_host_->ReadNowForTesting(); |
| 201 message_loop_.RunUntilIdle(); | 202 message_loop_.RunUntilIdle(); |
| 202 EXPECT_EQ("{\"id\": 2, \"echo\": {\"foo\": \"bar\"}}", last_posted_message_); | 203 EXPECT_EQ("{\"id\": 2, \"echo\": {\"foo\": \"bar\"}}", last_posted_message_); |
| 203 } | 204 } |
| 204 | 205 |
| 205 } // namespace extensions | 206 } // namespace extensions |
| OLD | NEW |