Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: remoting/host/setup/me2me_native_messaging_host_unittest.cc

Issue 558403002: Remote Assistance on Chrome OS Part II - Native Messaging renaming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on ToT Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/host/setup/me2me_native_messaging_host_main.cc ('k') | remoting/remoting_host.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "base/strings/stringize_macros.h" 14 #include "base/strings/stringize_macros.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "google_apis/gaia/gaia_oauth_client.h" 16 #include "google_apis/gaia/gaia_oauth_client.h"
17 #include "net/base/file_stream.h" 17 #include "net/base/file_stream.h"
18 #include "net/base/net_util.h" 18 #include "net/base/net_util.h"
19 #include "remoting/base/auto_thread_task_runner.h" 19 #include "remoting/base/auto_thread_task_runner.h"
20 #include "remoting/host/native_messaging/native_messaging_channel.h" 20 #include "remoting/host/native_messaging/pipe_messaging_channel.h"
21 #include "remoting/host/pin_hash.h" 21 #include "remoting/host/pin_hash.h"
22 #include "remoting/host/setup/test_util.h" 22 #include "remoting/host/setup/test_util.h"
23 #include "remoting/protocol/pairing_registry.h" 23 #include "remoting/protocol/pairing_registry.h"
24 #include "remoting/protocol/protocol_mock_objects.h" 24 #include "remoting/protocol/protocol_mock_objects.h"
25 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
26 26
27 using remoting::protocol::MockPairingRegistryDelegate; 27 using remoting::protocol::MockPairingRegistryDelegate;
28 using remoting::protocol::PairingRegistry; 28 using remoting::protocol::PairingRegistry;
29 using remoting::protocol::SynchronousPairingRegistry; 29 using remoting::protocol::SynchronousPairingRegistry;
30 30
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 316
317 daemon_controller_delegate_ = new MockDaemonControllerDelegate(); 317 daemon_controller_delegate_ = new MockDaemonControllerDelegate();
318 scoped_refptr<DaemonController> daemon_controller( 318 scoped_refptr<DaemonController> daemon_controller(
319 new DaemonController( 319 new DaemonController(
320 scoped_ptr<DaemonController::Delegate>(daemon_controller_delegate_))); 320 scoped_ptr<DaemonController::Delegate>(daemon_controller_delegate_)));
321 321
322 scoped_refptr<PairingRegistry> pairing_registry = 322 scoped_refptr<PairingRegistry> pairing_registry =
323 new SynchronousPairingRegistry(scoped_ptr<PairingRegistry::Delegate>( 323 new SynchronousPairingRegistry(scoped_ptr<PairingRegistry::Delegate>(
324 new MockPairingRegistryDelegate())); 324 new MockPairingRegistryDelegate()));
325 325
326 scoped_ptr<NativeMessagingChannel> channel( 326 scoped_ptr<extensions::NativeMessagingChannel> channel(
327 new NativeMessagingChannel(input_read_file.Pass(), 327 new PipeMessagingChannel(input_read_file.Pass(),
328 output_write_file.Pass())); 328 output_write_file.Pass()));
329 329
330 host_.reset(new Me2MeNativeMessagingHost( 330 host_.reset(new Me2MeNativeMessagingHost(
331 false, 331 false,
332 0, 332 0,
333 channel.Pass(), 333 channel.Pass(),
334 daemon_controller, 334 daemon_controller,
335 pairing_registry, 335 pairing_registry,
336 scoped_ptr<remoting::OAuthClient>())); 336 scoped_ptr<remoting::OAuthClient>()));
337 host_->Start(base::Bind(&Me2MeNativeMessagingHostTest::StopHost, 337 host_->Start(base::Bind(&Me2MeNativeMessagingHostTest::StopHost,
338 base::Unretained(this))); 338 base::Unretained(this)));
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 600
601 // Verify rejection if startDaemon request has no "consent" parameter. 601 // Verify rejection if startDaemon request has no "consent" parameter.
602 TEST_F(Me2MeNativeMessagingHostTest, StartDaemonNoConsent) { 602 TEST_F(Me2MeNativeMessagingHostTest, StartDaemonNoConsent) {
603 base::DictionaryValue message; 603 base::DictionaryValue message;
604 message.SetString("type", "startDaemon"); 604 message.SetString("type", "startDaemon");
605 message.Set("config", base::DictionaryValue().DeepCopy()); 605 message.Set("config", base::DictionaryValue().DeepCopy());
606 TestBadRequest(message); 606 TestBadRequest(message);
607 } 607 }
608 608
609 } // namespace remoting 609 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/setup/me2me_native_messaging_host_main.cc ('k') | remoting/remoting_host.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698