| OLD | NEW |
| 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 "remoting/host/config_file_watcher.h" | 5 #include "remoting/host/config_file_watcher.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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 DISALLOW_COPY_AND_ASSIGN(ConfigFileWatcherDelegate); | 34 DISALLOW_COPY_AND_ASSIGN(ConfigFileWatcherDelegate); |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 } // namespace | 37 } // namespace |
| 38 | 38 |
| 39 class ConfigFileWatcherTest : public testing::Test { | 39 class ConfigFileWatcherTest : public testing::Test { |
| 40 public: | 40 public: |
| 41 ConfigFileWatcherTest(); | 41 ConfigFileWatcherTest(); |
| 42 virtual ~ConfigFileWatcherTest(); | 42 ~ConfigFileWatcherTest() override; |
| 43 | 43 |
| 44 // testing::Test overrides | 44 // testing::Test overrides |
| 45 virtual void SetUp() override; | 45 void SetUp() override; |
| 46 virtual void TearDown() override; | 46 void TearDown() override; |
| 47 | 47 |
| 48 // Stops the config file watcher. | 48 // Stops the config file watcher. |
| 49 void StopWatcher(); | 49 void StopWatcher(); |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 base::MessageLoopForUI message_loop_; | 52 base::MessageLoopForUI message_loop_; |
| 53 base::RunLoop run_loop_; | 53 base::RunLoop run_loop_; |
| 54 | 54 |
| 55 ConfigFileWatcherDelegate delegate_; | 55 ConfigFileWatcherDelegate delegate_; |
| 56 | 56 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 // Modify the watched file. | 126 // Modify the watched file. |
| 127 std::string data("test"); | 127 std::string data("test"); |
| 128 EXPECT_NE(base::WriteFile(config_file_, data.c_str(), | 128 EXPECT_NE(base::WriteFile(config_file_, data.c_str(), |
| 129 static_cast<int>(data.size())), -1); | 129 static_cast<int>(data.size())), -1); |
| 130 | 130 |
| 131 run_loop_.Run(); | 131 run_loop_.Run(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace remoting | 134 } // namespace remoting |
| OLD | NEW |