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 "content/shell/browser/webkit_test_controller.h" | 5 #include "content/shell/browser/webkit_test_controller.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 *output_ << message << "\n"; | 163 *output_ << message << "\n"; |
164 PrintTextFooter(); | 164 PrintTextFooter(); |
165 PrintImageFooter(); | 165 PrintImageFooter(); |
166 } | 166 } |
167 | 167 |
168 void WebKitTestResultPrinter::PrintEncodedBinaryData( | 168 void WebKitTestResultPrinter::PrintEncodedBinaryData( |
169 const std::vector<unsigned char>& data) { | 169 const std::vector<unsigned char>& data) { |
170 *output_ << "Content-Transfer-Encoding: base64\n"; | 170 *output_ << "Content-Transfer-Encoding: base64\n"; |
171 | 171 |
172 std::string data_base64; | 172 std::string data_base64; |
173 const bool success = base::Base64Encode( | 173 base::Base64Encode( |
174 base::StringPiece(reinterpret_cast<const char*>(&data[0]), data.size()), | 174 base::StringPiece(reinterpret_cast<const char*>(&data[0]), data.size()), |
175 &data_base64); | 175 &data_base64); |
176 DCHECK(success); | |
177 | 176 |
178 *output_ << "Content-Length: " << data_base64.length() << "\n"; | 177 *output_ << "Content-Length: " << data_base64.length() << "\n"; |
179 output_->write(data_base64.c_str(), data_base64.length()); | 178 output_->write(data_base64.c_str(), data_base64.length()); |
180 } | 179 } |
181 | 180 |
182 void WebKitTestResultPrinter::CloseStderr() { | 181 void WebKitTestResultPrinter::CloseStderr() { |
183 if (state_ != AFTER_TEST) | 182 if (state_ != AFTER_TEST) |
184 return; | 183 return; |
185 if (!capture_text_only_) { | 184 if (!capture_text_only_) { |
186 *error_ << "#EOF\n"; | 185 *error_ << "#EOF\n"; |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 } | 646 } |
648 base::MessageLoop::current()->RunUntilIdle(); | 647 base::MessageLoop::current()->RunUntilIdle(); |
649 } | 648 } |
650 | 649 |
651 void WebKitTestController::OnResetDone() { | 650 void WebKitTestController::OnResetDone() { |
652 base::MessageLoop::current()->PostTask(FROM_HERE, | 651 base::MessageLoop::current()->PostTask(FROM_HERE, |
653 base::MessageLoop::QuitClosure()); | 652 base::MessageLoop::QuitClosure()); |
654 } | 653 } |
655 | 654 |
656 } // namespace content | 655 } // namespace content |
OLD | NEW |