| 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 "sky/tools/tester/test_runner.h" | 5 #include "sky/tools/tester/test_runner.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "mojo/public/cpp/application/connect.h" | 9 #include "mojo/public/cpp/application/connect.h" |
| 10 #include "mojo/public/cpp/application/service_provider_impl.h" | 10 #include "mojo/public/cpp/application/service_provider_impl.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 std::cout << "Content-Type: text/plain\n"; | 48 std::cout << "Content-Type: text/plain\n"; |
| 49 std::cout << test_result << "\n"; | 49 std::cout << test_result << "\n"; |
| 50 std::cout << "#EOF\n"; | 50 std::cout << "#EOF\n"; |
| 51 | 51 |
| 52 // TODO(ojan): Don't generate the pixels if enable_pixel_dumping_ is false. | 52 // TODO(ojan): Don't generate the pixels if enable_pixel_dumping_ is false. |
| 53 if (enable_pixel_dumping_) { | 53 if (enable_pixel_dumping_) { |
| 54 // TODO(ojan): Add real hashes here once we want to do pixel tests. | 54 // TODO(ojan): Add real hashes here once we want to do pixel tests. |
| 55 std::cout << "\nActualHash: FAKEHASHSTUB\n"; | 55 std::cout << "\nActualHash: FAKEHASHSTUB\n"; |
| 56 std::cout << "Content-Type: image/png\n"; | 56 std::cout << "Content-Type: image/png\n"; |
| 57 std::cout << "Content-Length: " << pixels.size() << "\n"; | 57 std::cout << "Content-Length: " << pixels.size() << "\n"; |
| 58 CHECK(pixels.size()) << "Could not dump pixels. Did you call notifyTestCompl
ete before the first paint?"; |
| 58 std::cout.write( | 59 std::cout.write( |
| 59 reinterpret_cast<const char*>(&pixels[0]), pixels.size()); | 60 reinterpret_cast<const char*>(&pixels[0]), pixels.size()); |
| 60 } | 61 } |
| 61 | 62 |
| 62 std::cout << "#EOF\n"; | 63 std::cout << "#EOF\n"; |
| 63 std::cout.flush(); | 64 std::cout.flush(); |
| 64 std::cerr << "#EOF\n"; | 65 std::cerr << "#EOF\n"; |
| 65 std::cerr.flush(); | 66 std::cerr.flush(); |
| 66 | 67 |
| 67 client_->OnTestComplete(); | 68 client_->OnTestComplete(); |
| 68 } | 69 } |
| 69 | 70 |
| 70 } // namespace tester | 71 } // namespace tester |
| 71 } // namespace sky | 72 } // namespace sky |
| OLD | NEW |