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

Unified Diff: chrome/browser/android/vr_shell/test/paths.cc

Issue 2757213003: Implementing glTF 1.0 parser (Closed)
Patch Set: Resolving merge. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/test/paths.h ('k') | chrome/browser/android/vr_shell/vr_math.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/test/paths.cc
diff --git a/chrome/browser/android/vr_shell/test/paths.cc b/chrome/browser/android/vr_shell/test/paths.cc
new file mode 100644
index 0000000000000000000000000000000000000000..eb8d941f3ee7197cdb3d8c7e29c6e0a415f7b6a6
--- /dev/null
+++ b/chrome/browser/android/vr_shell/test/paths.cc
@@ -0,0 +1,48 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/vr_shell/test/paths.h"
+
+#include "base/files/file_path.h"
+#include "base/files/file_util.h"
+#include "base/path_service.h"
+
+namespace vr_shell {
+namespace test {
+
+namespace {
+
+bool PathProvider(int key, base::FilePath* result) {
+ base::FilePath cur;
+ switch (key) {
+ // The following are only valid in the development environment, and
+ // will fail if executed from an installed executable (because the
+ // generated path won't exist).
+ case DIR_TEST_DATA:
+ if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur))
+ return false;
+ cur = cur.Append(FILE_PATH_LITERAL("chrome"))
+ .Append(FILE_PATH_LITERAL("browser"))
+ .Append(FILE_PATH_LITERAL("android"))
+ .Append(FILE_PATH_LITERAL("vr_shell"))
+ .Append(FILE_PATH_LITERAL("test"))
+ .Append(FILE_PATH_LITERAL("data"));
+ if (!base::PathExists(cur))
+ return false;
+ break;
+ default:
+ return false;
+ }
+ *result = cur;
+ return true;
+}
+
+} // namespace
+
+void RegisterPathProvider() {
+ PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
+}
+
+} // namespace test
+} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/test/paths.h ('k') | chrome/browser/android/vr_shell/vr_math.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698