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

Unified Diff: ppapi/tests/test_file_system.cc

Issue 52233002: [PPAPI] Added VarResource_Dev class. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix Windows compile. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/tests/test_file_system.h ('k') | ppapi/tests/test_post_message.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_file_system.cc
diff --git a/ppapi/tests/test_file_system.cc b/ppapi/tests/test_file_system.cc
index 7badabb4233e79ed632a6a917a9f0179dd0c5337..858e2e3e6ae5408022b75eb5542ae8b219754149 100644
--- a/ppapi/tests/test_file_system.cc
+++ b/ppapi/tests/test_file_system.cc
@@ -7,7 +7,9 @@
#include <string.h>
#include "ppapi/c/pp_errors.h"
+#include "ppapi/cpp/file_io.h"
#include "ppapi/cpp/file_system.h"
+#include "ppapi/cpp/resource.h"
#include "ppapi/tests/test_utils.h"
#include "ppapi/tests/testing_instance.h"
@@ -20,6 +22,7 @@ bool TestFileSystem::Init() {
void TestFileSystem::RunTests(const std::string& filter) {
RUN_CALLBACK_TEST(TestFileSystem, Open, filter);
RUN_CALLBACK_TEST(TestFileSystem, MultipleOpens, filter);
+ RUN_CALLBACK_TEST(TestFileSystem, ResourceConversion, filter);
}
std::string TestFileSystem::TestOpen() {
@@ -67,3 +70,21 @@ std::string TestFileSystem::TestMultipleOpens() {
PASS();
}
+
+std::string TestFileSystem::TestResourceConversion() {
+ // Test conversion from file system Resource to FileSystem.
+ pp::FileSystem file_system(instance_, PP_FILESYSTEMTYPE_LOCALTEMPORARY);
+ pp::Resource file_system_resource(file_system);
+ ASSERT_TRUE(pp::FileSystem::IsFileSystem(file_system_resource));
+ pp::FileSystem file_system_resource_file_system(file_system_resource);
+ ASSERT_FALSE(file_system_resource_file_system.is_null());
+
+ // Test conversion that a non-file system Resource does not register as a
+ // FileSystem. (We cannot test conversion, since this is an assertion on a
+ // debug build.)
+ pp::FileIO non_file_system(instance_);
+ pp::Resource non_file_system_resource(non_file_system);
+ ASSERT_FALSE(pp::FileSystem::IsFileSystem(non_file_system_resource));
+
+ PASS();
+}
« no previous file with comments | « ppapi/tests/test_file_system.h ('k') | ppapi/tests/test_post_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698