OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/containers/scoped_ptr_hash_map.h" | 7 #include "base/containers/scoped_ptr_hash_map.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/devtools/device/adb/mock_adb_server.h" | 9 #include "chrome/browser/devtools/device/adb/mock_adb_server.h" |
10 #include "chrome/browser/devtools/device/devtools_android_bridge.h" | 10 #include "chrome/browser/devtools/device/devtools_android_bridge.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 scoped_refptr<net::IOBuffer> buffer, | 368 scoped_refptr<net::IOBuffer> buffer, |
369 int size) | 369 int size) |
370 : callback(callback), buffer(buffer), size(size) {} | 370 : callback(callback), buffer(buffer), size(size) {} |
371 }; | 371 }; |
372 | 372 |
373 scoped_refptr<MockUsbDevice<T> > device_; | 373 scoped_refptr<MockUsbDevice<T> > device_; |
374 uint32 remaining_body_length_; | 374 uint32 remaining_body_length_; |
375 scoped_ptr<AdbMessage> current_message_; | 375 scoped_ptr<AdbMessage> current_message_; |
376 std::vector<char> output_buffer_; | 376 std::vector<char> output_buffer_; |
377 std::queue<Query> queries_; | 377 std::queue<Query> queries_; |
378 base::ScopedPtrHashMap<int, MockLocalSocket> local_sockets_; | 378 base::ScopedPtrHashMap<int, scoped_ptr<MockLocalSocket>> local_sockets_; |
379 int last_local_socket_; | 379 int last_local_socket_; |
380 bool broken_; | 380 bool broken_; |
381 }; | 381 }; |
382 | 382 |
383 template <class T> | 383 template <class T> |
384 class MockUsbDevice : public UsbDevice { | 384 class MockUsbDevice : public UsbDevice { |
385 public: | 385 public: |
386 MockUsbDevice() | 386 MockUsbDevice() |
387 : UsbDevice(0, | 387 : UsbDevice(0, |
388 0, | 388 0, |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 EXPECT_EQ(2, listener.invoked_); | 783 EXPECT_EQ(2, listener.invoked_); |
784 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); | 784 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); |
785 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); | 785 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
786 } | 786 } |
787 | 787 |
788 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { | 788 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { |
789 MockCountListenerForCheckingTraits listener(adb_bridge_); | 789 MockCountListenerForCheckingTraits listener(adb_bridge_); |
790 adb_bridge_->AddDeviceCountListener(&listener); | 790 adb_bridge_->AddDeviceCountListener(&listener); |
791 runner_->Run(); | 791 runner_->Run(); |
792 } | 792 } |
OLD | NEW |