| 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/files/file.h" | 6 #include "base/files/file.h" |
| 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_file.h" | 9 #include "base/files/scoped_file.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 private: | 88 private: |
| 89 mutable base::File read_file_; | 89 mutable base::File read_file_; |
| 90 mutable base::File write_file_; | 90 mutable base::File write_file_; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 class NativeMessagingTest : public ::testing::Test, | 93 class NativeMessagingTest : public ::testing::Test, |
| 94 public NativeMessageHost::Client, | 94 public NativeMessageHost::Client, |
| 95 public base::SupportsWeakPtr<NativeMessagingTest> { | 95 public base::SupportsWeakPtr<NativeMessagingTest> { |
| 96 protected: | 96 protected: |
| 97 NativeMessagingTest() | 97 NativeMessagingTest() |
| 98 : current_channel_(chrome::VersionInfo::CHANNEL_DEV), | 98 : current_channel_(version_info::Channel::DEV), |
| 99 thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), | 99 thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), |
| 100 channel_closed_(false) {} | 100 channel_closed_(false) {} |
| 101 | 101 |
| 102 void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); } | 102 void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); } |
| 103 | 103 |
| 104 void TearDown() override { | 104 void TearDown() override { |
| 105 if (native_message_host_.get()) { | 105 if (native_message_host_.get()) { |
| 106 BrowserThread::DeleteSoon( | 106 BrowserThread::DeleteSoon( |
| 107 BrowserThread::IO, FROM_HERE, native_message_host_.release()); | 107 BrowserThread::IO, FROM_HERE, native_message_host_.release()); |
| 108 } | 108 } |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 native_message_host_->Start(this); | 325 native_message_host_->Start(this); |
| 326 ASSERT_TRUE(native_message_host_.get()); | 326 ASSERT_TRUE(native_message_host_.get()); |
| 327 run_loop_.reset(new base::RunLoop()); | 327 run_loop_.reset(new base::RunLoop()); |
| 328 run_loop_->Run(); | 328 run_loop_->Run(); |
| 329 | 329 |
| 330 // The host should fail to start. | 330 // The host should fail to start. |
| 331 ASSERT_TRUE(channel_closed_); | 331 ASSERT_TRUE(channel_closed_); |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace extensions | 334 } // namespace extensions |
| OLD | NEW |