| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/tests/test_url_loader.h" | 5 #include "ppapi/tests/test_url_loader.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 } // namespace | 57 } // namespace |
| 58 | 58 |
| 59 TestURLLoader::TestURLLoader(TestingInstance* instance) | 59 TestURLLoader::TestURLLoader(TestingInstance* instance) |
| 60 : TestCase(instance), | 60 : TestCase(instance), |
| 61 file_io_trusted_interface_(NULL), | 61 file_io_trusted_interface_(NULL), |
| 62 url_loader_trusted_interface_(NULL) { | 62 url_loader_trusted_interface_(NULL) { |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool TestURLLoader::Init() { | 65 bool TestURLLoader::Init() { |
| 66 if (!InitTestingInterface()) { | 66 if (!CheckTestingInterface()) { |
| 67 instance_->AppendError("Testing interface not available"); | 67 instance_->AppendError("Testing interface not available"); |
| 68 return false; | 68 return false; |
| 69 } | 69 } |
| 70 | 70 |
| 71 const PPB_FileIO* file_io_interface = static_cast<const PPB_FileIO*>( | 71 const PPB_FileIO* file_io_interface = static_cast<const PPB_FileIO*>( |
| 72 pp::Module::Get()->GetBrowserInterface(PPB_FILEIO_INTERFACE)); | 72 pp::Module::Get()->GetBrowserInterface(PPB_FILEIO_INTERFACE)); |
| 73 if (!file_io_interface) | 73 if (!file_io_interface) |
| 74 instance_->AppendError("FileIO interface not available"); | 74 instance_->AppendError("FileIO interface not available"); |
| 75 | 75 |
| 76 file_io_trusted_interface_ = static_cast<const PPB_FileIOTrusted*>( | 76 file_io_trusted_interface_ = static_cast<const PPB_FileIOTrusted*>( |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 return error; | 872 return error; |
| 873 if (body != "hello\n") | 873 if (body != "hello\n") |
| 874 return ReportError("Couldn't read data", rv); | 874 return ReportError("Couldn't read data", rv); |
| 875 | 875 |
| 876 PASS(); | 876 PASS(); |
| 877 } | 877 } |
| 878 | 878 |
| 879 // TODO(viettrungluu): Add tests for Get{Upload,Download}Progress, Close | 879 // TODO(viettrungluu): Add tests for Get{Upload,Download}Progress, Close |
| 880 // (including abort tests if applicable). | 880 // (including abort tests if applicable). |
| 881 | 881 |
| OLD | NEW |