Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1178)

Side by Side Diff: ppapi/tests/test_url_loader.cc

Issue 14371021: Implementation of URLLoader using PluginResource/ResourceHost. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase, track src/webkit gypi changes. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/shared_impl/resource.cc ('k') | ppapi/thunk/interfaces_ppb_private.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 if (bytes_received == total_bytes_to_be_received) 793 if (bytes_received == total_bytes_to_be_received)
794 break; 794 break;
795 // Yield if we're on the main thread, so that URLLoader can receive more 795 // Yield if we're on the main thread, so that URLLoader can receive more
796 // data. 796 // data.
797 if (pp::Module::Get()->core()->IsMainThread()) { 797 if (pp::Module::Get()->core()->IsMainThread()) {
798 NestedEvent event(instance_->pp_instance()); 798 NestedEvent event(instance_->pp_instance());
799 event.PostSignal(10); 799 event.PostSignal(10);
800 event.Wait(); 800 event.Wait();
801 } 801 }
802 } 802 }
803
804 // The loader should now have the data and have finished successfully. 803 // The loader should now have the data and have finished successfully.
805 std::string body; 804 std::string body;
806 std::string error = ReadEntireResponseBody(&loader, &body); 805 std::string error = ReadEntireResponseBody(&loader, &body);
807 if (!error.empty()) 806 if (!error.empty())
808 return error; 807 return error;
809 if (body != "hello\n") 808 if (body != "hello\n")
810 return ReportError("Couldn't read data", callback.result()); 809 return ReportError("Couldn't read data", callback.result());
811 810
812 PASS(); 811 PASS();
813 } 812 }
(...skipping 25 matching lines...) Expand all
839 if (rv != PP_ERROR_FAILED) { 838 if (rv != PP_ERROR_FAILED) {
840 return ReportError("The lower buffer value was higher than the upper but " 839 return ReportError("The lower buffer value was higher than the upper but "
841 "the URLLoader did not fail.", rv); 840 "the URLLoader did not fail.", rv);
842 } 841 }
843 842
844 PASS(); 843 PASS();
845 } 844 }
846 845
847 // TODO(viettrungluu): Add tests for Get{Upload,Download}Progress, Close 846 // TODO(viettrungluu): Add tests for Get{Upload,Download}Progress, Close
848 // (including abort tests if applicable). 847 // (including abort tests if applicable).
OLDNEW
« no previous file with comments | « ppapi/shared_impl/resource.cc ('k') | ppapi/thunk/interfaces_ppb_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698