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

Unified Diff: chrome/browser/android/vr_shell/run_all_unittests.cc

Issue 2937263002: VR: Support loading string resources in unit tests. (Closed)
Patch Set: Remove test string used to validate change through the trybots. Created 3 years, 6 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
Index: chrome/browser/android/vr_shell/run_all_unittests.cc
diff --git a/chrome/browser/android/vr_shell/run_all_unittests.cc b/chrome/browser/android/vr_shell/run_all_unittests.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7c615de3378cb733dee38a3e0c6c11894ff8221b
--- /dev/null
+++ b/chrome/browser/android/vr_shell/run_all_unittests.cc
@@ -0,0 +1,52 @@
+// 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 "base/bind.h"
+#include "base/files/file_util.h"
+#include "base/path_service.h"
+#include "base/test/launcher/unit_test_launcher.h"
+#include "base/test/test_suite.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_paths.h"
+
+namespace {
+
+class VrCommonTestSuite : public base::TestSuite {
+ public:
+ VrCommonTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
+
+ protected:
+ void Initialize() override {
+ base::TestSuite::Initialize();
+
+ ui::RegisterPathProvider();
+
+ base::FilePath pak_path;
+#if defined(OS_ANDROID)
+ PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path);
+#else
+ PathService::Get(base::DIR_MODULE, &pak_path);
+#endif
+ ui::ResourceBundle::InitSharedInstanceWithPakPath(
+ pak_path.AppendASCII("components_tests_resources.pak"));
+ }
+
+ void Shutdown() override {
+ ui::ResourceBundle::CleanupSharedInstance();
+ base::TestSuite::Shutdown();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VrCommonTestSuite);
+};
+
+} // namespace
+
+int main(int argc, char** argv) {
+ VrCommonTestSuite test_suite(argc, argv);
+
+ return base::LaunchUnitTests(
+ argc, argv,
+ base::Bind(&VrCommonTestSuite::Run, base::Unretained(&test_suite)));
+}
« chrome/browser/android/vr_shell/BUILD.gn ('K') | « chrome/browser/android/vr_shell/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698