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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 return error; | 867 return error; |
868 if (body != "hello\n") | 868 if (body != "hello\n") |
869 return ReportError("Couldn't read data", rv); | 869 return ReportError("Couldn't read data", rv); |
870 | 870 |
871 PASS(); | 871 PASS(); |
872 } | 872 } |
873 | 873 |
874 // TODO(viettrungluu): Add tests for Get{Upload,Download}Progress, Close | 874 // TODO(viettrungluu): Add tests for Get{Upload,Download}Progress, Close |
875 // (including abort tests if applicable). | 875 // (including abort tests if applicable). |
876 | 876 |
OLD | NEW |