| 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 "chrome/browser/printing/cloud_print/privet_http.h" | 5 #include "chrome/browser/printing/cloud_print/privet_http.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 new FakePWGRasterConverter); | 764 new FakePWGRasterConverter); |
| 765 pwg_converter_ = pwg_converter.get(); | 765 pwg_converter_ = pwg_converter.get(); |
| 766 local_print_operation_->SetPWGRasterConverterForTesting( | 766 local_print_operation_->SetPWGRasterConverterForTesting( |
| 767 std::move(pwg_converter)); | 767 std::move(pwg_converter)); |
| 768 } | 768 } |
| 769 | 769 |
| 770 scoped_refptr<base::RefCountedBytes> RefCountedBytesFromString( | 770 scoped_refptr<base::RefCountedBytes> RefCountedBytesFromString( |
| 771 std::string str) { | 771 std::string str) { |
| 772 std::vector<unsigned char> str_vec; | 772 std::vector<unsigned char> str_vec; |
| 773 str_vec.insert(str_vec.begin(), str.begin(), str.end()); | 773 str_vec.insert(str_vec.begin(), str.begin(), str.end()); |
| 774 return scoped_refptr<base::RefCountedBytes>( | 774 return base::RefCountedBytes::TakeVector(&str_vec); |
| 775 base::RefCountedBytes::TakeVector(&str_vec)); | |
| 776 } | 775 } |
| 777 | 776 |
| 778 protected: | 777 protected: |
| 779 scoped_ptr<PrivetLocalPrintOperation> local_print_operation_; | 778 scoped_ptr<PrivetLocalPrintOperation> local_print_operation_; |
| 780 StrictMock<MockLocalPrintDelegate> local_print_delegate_; | 779 StrictMock<MockLocalPrintDelegate> local_print_delegate_; |
| 781 FakePWGRasterConverter* pwg_converter_; | 780 FakePWGRasterConverter* pwg_converter_; |
| 782 }; | 781 }; |
| 783 | 782 |
| 784 INSTANTIATE_TEST_CASE_P(PrivetTests, | 783 INSTANTIATE_TEST_CASE_P(PrivetTests, |
| 785 PrivetLocalPrintTest, | 784 PrivetLocalPrintTest, |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 base::Closure quit_; | 1111 base::Closure quit_; |
| 1113 }; | 1112 }; |
| 1114 | 1113 |
| 1115 TEST_F(PrivetHttpWithServerTest, HttpServer) { | 1114 TEST_F(PrivetHttpWithServerTest, HttpServer) { |
| 1116 EXPECT_TRUE(Run()); | 1115 EXPECT_TRUE(Run()); |
| 1117 } | 1116 } |
| 1118 | 1117 |
| 1119 } // namespace | 1118 } // namespace |
| 1120 | 1119 |
| 1121 } // namespace cloud_print | 1120 } // namespace cloud_print |
| OLD | NEW |