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

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

Issue 18063005: Do PPB_FileIO Query and Read in the plugin process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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_file_ref.h" 5 #include "ppapi/tests/test_file_ref.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <sstream> 9 #include <sstream>
10 #include <vector> 10 #include <vector>
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 CHECK_CALLBACK_BEHAVIOR(callback); 359 CHECK_CALLBACK_BEHAVIOR(callback);
360 ASSERT_EQ(PP_OK, callback.result()); 360 ASSERT_EQ(PP_OK, callback.result());
361 361
362 // Write some data to have a non-zero file size. 362 // Write some data to have a non-zero file size.
363 callback.WaitForResult(file_io.Write(0, "test", 4, callback.GetCallback())); 363 callback.WaitForResult(file_io.Write(0, "test", 4, callback.GetCallback()));
364 CHECK_CALLBACK_BEHAVIOR(callback); 364 CHECK_CALLBACK_BEHAVIOR(callback);
365 ASSERT_EQ(4, callback.result()); 365 ASSERT_EQ(4, callback.result());
366 366
367 // Touch. 367 // Touch.
368 // last_access_time's granularity is 1 day 368 // last_access_time's granularity is 1 day
369 const PP_Time last_access_time = 123 * 24 * 3600.0;
369 // last_modified_time's granularity is 2 seconds 370 // last_modified_time's granularity is 2 seconds
370 const PP_Time last_access_time = 123 * 24 * 3600.0; 371 // See note in test_file_io.cc for why we use this time.
371 const PP_Time last_modified_time = 246.0; 372 const PP_Time last_modified_time = 100 * 24 * 3600.0;
372 callback.WaitForResult(file_ref.Touch(last_access_time, last_modified_time, 373 callback.WaitForResult(file_ref.Touch(last_access_time, last_modified_time,
373 callback.GetCallback())); 374 callback.GetCallback()));
374 CHECK_CALLBACK_BEHAVIOR(callback); 375 CHECK_CALLBACK_BEHAVIOR(callback);
375 ASSERT_EQ(PP_OK, callback.result()); 376 ASSERT_EQ(PP_OK, callback.result());
376 377
377 // Touch aborted. 378 // Touch aborted.
378 int32_t rv = PP_ERROR_FAILED; 379 int32_t rv = PP_ERROR_FAILED;
379 { 380 {
380 rv = pp::FileRef(file_system, "/file_touch_abort") 381 rv = pp::FileRef(file_system, "/file_touch_abort")
381 .Touch(last_access_time, last_modified_time, callback.GetCallback()); 382 .Touch(last_access_time, last_modified_time, callback.GetCallback());
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 { 744 {
744 rv = pp::FileRef(file_system, test_dir_name) 745 rv = pp::FileRef(file_system, test_dir_name)
745 .ReadDirectoryEntries(output_callback.GetCallback()); 746 .ReadDirectoryEntries(output_callback.GetCallback());
746 } 747 }
747 output_callback.WaitForAbortResult(rv); 748 output_callback.WaitForAbortResult(rv);
748 CHECK_CALLBACK_BEHAVIOR(output_callback); 749 CHECK_CALLBACK_BEHAVIOR(output_callback);
749 750
750 751
751 PASS(); 752 PASS();
752 } 753 }
OLDNEW
« ppapi/shared_impl/test_globals.h ('K') | « ppapi/tests/test_file_io.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698