Index: chrome/browser/android/vr_shell/gltf_parser_unittest.cc |
diff --git a/chrome/browser/android/vr_shell/gltf_parser_unittest.cc b/chrome/browser/android/vr_shell/gltf_parser_unittest.cc |
index ff30ce2bbde61ea112db687f0d5c58d2947d4fec..567632060ef3be64836d10927675e7d797aa2418 100644 |
--- a/chrome/browser/android/vr_shell/gltf_parser_unittest.cc |
+++ b/chrome/browser/android/vr_shell/gltf_parser_unittest.cc |
@@ -17,11 +17,18 @@ |
namespace vr_shell { |
-TEST(GltfParser, Parse) { |
- test::RegisterPathProvider(); |
- base::FilePath gltf_path; |
- PathService::Get(test::DIR_TEST_DATA, &gltf_path); |
- gltf_path = gltf_path.Append("sample_inline.gltf"); |
+class GltfParserTest : public testing::Test { |
+ protected: |
+ void SetUp() override { |
+ test::RegisterPathProvider(); |
+ PathService::Get(test::DIR_TEST_DATA, &data_dir_); |
+ } |
+ |
+ base::FilePath data_dir_; |
+}; |
+ |
+TEST_F(GltfParserTest, Parse) { |
+ auto gltf_path = data_dir_.Append("sample_inline.gltf"); |
int error_code; |
std::string error_msg; |
@@ -92,4 +99,16 @@ TEST(GltfParser, Parse) { |
EXPECT_EQ(scene, gltf_model->GetMainScene()); |
} |
+TEST_F(GltfParserTest, ParseExternal) { |
+ auto gltf_path = data_dir_.Append("sample_external.gltf"); |
+ |
+ GltfParser parser; |
+ auto gltf_model = parser.Parse(gltf_path); |
+ EXPECT_NE(nullptr, gltf_model); |
+ const gltf::Buffer* buffer = gltf_model->GetBuffer(0); |
+ EXPECT_NE(nullptr, buffer); |
+ EXPECT_EQ("HELLO WORLD!", *buffer); |
+ EXPECT_EQ(12u, buffer->length()); |
+} |
+ |
} // namespace vr_shell |