| 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 "chrome/browser/extensions/api/messaging/native_message_process_host.h" |
| 6 |
| 5 #include "base/bind.h" | 7 #include "base/bind.h" |
| 6 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 7 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_file.h" | 11 #include "base/files/scoped_file.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 11 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
| 12 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 14 #include "base/rand_util.h" | 16 #include "base/rand_util.h" |
| 15 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
| 16 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
| 17 #include "base/test/test_timeouts.h" | 19 #include "base/test/test_timeouts.h" |
| 18 #include "base/threading/platform_thread.h" | 20 #include "base/threading/platform_thread.h" |
| 19 #include "base/threading/sequenced_worker_pool.h" | 21 #include "base/threading/sequenced_worker_pool.h" |
| 20 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 21 #include "chrome/browser/extensions/api/messaging/native_message_process_host.h" | |
| 22 #include "chrome/browser/extensions/api/messaging/native_messaging_test_util.h" | 23 #include "chrome/browser/extensions/api/messaging/native_messaging_test_util.h" |
| 23 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" | 24 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" |
| 24 #include "chrome/common/chrome_version_info.h" | 25 #include "chrome/common/channel_info.h" |
| 25 #include "chrome/common/extensions/features/feature_channel.h" | 26 #include "chrome/common/extensions/features/feature_channel.h" |
| 27 #include "components/version_info/version_info.h" |
| 26 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 27 #include "content/public/test/test_browser_thread_bundle.h" | 29 #include "content/public/test/test_browser_thread_bundle.h" |
| 28 #include "extensions/common/extension.h" | 30 #include "extensions/common/extension.h" |
| 29 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
| 30 | 32 |
| 31 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
| 32 #include <windows.h> | 34 #include <windows.h> |
| 33 #include "base/win/scoped_handle.h" | 35 #include "base/win/scoped_handle.h" |
| 34 #else | 36 #else |
| 35 #include <unistd.h> | 37 #include <unistd.h> |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 native_message_host_->Start(this); | 327 native_message_host_->Start(this); |
| 326 ASSERT_TRUE(native_message_host_.get()); | 328 ASSERT_TRUE(native_message_host_.get()); |
| 327 run_loop_.reset(new base::RunLoop()); | 329 run_loop_.reset(new base::RunLoop()); |
| 328 run_loop_->Run(); | 330 run_loop_->Run(); |
| 329 | 331 |
| 330 // The host should fail to start. | 332 // The host should fail to start. |
| 331 ASSERT_TRUE(channel_closed_); | 333 ASSERT_TRUE(channel_closed_); |
| 332 } | 334 } |
| 333 | 335 |
| 334 } // namespace extensions | 336 } // namespace extensions |
| OLD | NEW |