OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/setup/me2me_native_messaging_host.h" | 5 #include "remoting/host/setup/me2me_native_messaging_host.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 EXPECT_EQ("OK", value); | 128 EXPECT_EQ("OK", value); |
129 } | 129 } |
130 | 130 |
131 } // namespace | 131 } // namespace |
132 | 132 |
133 namespace remoting { | 133 namespace remoting { |
134 | 134 |
135 class MockDaemonControllerDelegate : public DaemonController::Delegate { | 135 class MockDaemonControllerDelegate : public DaemonController::Delegate { |
136 public: | 136 public: |
137 MockDaemonControllerDelegate(); | 137 MockDaemonControllerDelegate(); |
138 virtual ~MockDaemonControllerDelegate(); | 138 ~MockDaemonControllerDelegate() override; |
139 | 139 |
140 // DaemonController::Delegate interface. | 140 // DaemonController::Delegate interface. |
141 virtual DaemonController::State GetState() override; | 141 DaemonController::State GetState() override; |
142 virtual scoped_ptr<base::DictionaryValue> GetConfig() override; | 142 scoped_ptr<base::DictionaryValue> GetConfig() override; |
143 virtual void InstallHost( | 143 void InstallHost(const DaemonController::CompletionCallback& done) override; |
144 const DaemonController::CompletionCallback& done) override; | 144 void SetConfigAndStart( |
145 virtual void SetConfigAndStart( | |
146 scoped_ptr<base::DictionaryValue> config, | 145 scoped_ptr<base::DictionaryValue> config, |
147 bool consent, | 146 bool consent, |
148 const DaemonController::CompletionCallback& done) override; | 147 const DaemonController::CompletionCallback& done) override; |
149 virtual void UpdateConfig( | 148 void UpdateConfig(scoped_ptr<base::DictionaryValue> config, |
150 scoped_ptr<base::DictionaryValue> config, | 149 const DaemonController::CompletionCallback& done) override; |
151 const DaemonController::CompletionCallback& done) override; | 150 void Stop(const DaemonController::CompletionCallback& done) override; |
152 virtual void Stop(const DaemonController::CompletionCallback& done) override; | 151 void SetWindow(void* window_handle) override; |
153 virtual void SetWindow(void* window_handle) override; | 152 std::string GetVersion() override; |
154 virtual std::string GetVersion() override; | 153 DaemonController::UsageStatsConsent GetUsageStatsConsent() override; |
155 virtual DaemonController::UsageStatsConsent GetUsageStatsConsent() override; | |
156 | 154 |
157 private: | 155 private: |
158 DISALLOW_COPY_AND_ASSIGN(MockDaemonControllerDelegate); | 156 DISALLOW_COPY_AND_ASSIGN(MockDaemonControllerDelegate); |
159 }; | 157 }; |
160 | 158 |
161 MockDaemonControllerDelegate::MockDaemonControllerDelegate() {} | 159 MockDaemonControllerDelegate::MockDaemonControllerDelegate() {} |
162 | 160 |
163 MockDaemonControllerDelegate::~MockDaemonControllerDelegate() {} | 161 MockDaemonControllerDelegate::~MockDaemonControllerDelegate() {} |
164 | 162 |
165 DaemonController::State MockDaemonControllerDelegate::GetState() { | 163 DaemonController::State MockDaemonControllerDelegate::GetState() { |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 590 |
593 // Verify rejection if startDaemon request has no "consent" parameter. | 591 // Verify rejection if startDaemon request has no "consent" parameter. |
594 TEST_F(Me2MeNativeMessagingHostTest, StartDaemonNoConsent) { | 592 TEST_F(Me2MeNativeMessagingHostTest, StartDaemonNoConsent) { |
595 base::DictionaryValue message; | 593 base::DictionaryValue message; |
596 message.SetString("type", "startDaemon"); | 594 message.SetString("type", "startDaemon"); |
597 message.Set("config", base::DictionaryValue().DeepCopy()); | 595 message.Set("config", base::DictionaryValue().DeepCopy()); |
598 TestBadRequest(message); | 596 TestBadRequest(message); |
599 } | 597 } |
600 | 598 |
601 } // namespace remoting | 599 } // namespace remoting |
OLD | NEW |