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

Unified Diff: ui/arc/test/run_all_unittests.cc

Issue 2723143002: Add unittests of ArcCustomNotificationView (Closed)
Patch Set: Created 3 years, 10 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: ui/arc/test/run_all_unittests.cc
diff --git a/ui/arc/test/run_all_unittests.cc b/ui/arc/test/run_all_unittests.cc
index 92e28e4bc2ef21acede81193f132cd22481f4a7d..befbb1d053afba2c5f04e6f57ed2565325016310 100644
--- a/ui/arc/test/run_all_unittests.cc
+++ b/ui/arc/test/run_all_unittests.cc
@@ -3,15 +3,48 @@
// found in the LICENSE file.
#include "base/bind.h"
+#include "base/path_service.h"
#include "base/test/launcher/unit_test_launcher.h"
+#include "base/test/test_discardable_memory_allocator.h"
#include "base/test/test_suite.h"
#include "mojo/edk/embedder/embedder.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_paths.h"
+#include "ui/gl/test/gl_surface_test_support.h"
+
+namespace {
+
+class UiArcTestSuite : public base::TestSuite {
+ public:
+ UiArcTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
+
+ protected:
+ void Initialize() override {
+ base::TestSuite::Initialize();
+ ui::RegisterPathProvider();
+
+ base::FilePath ui_test_pak_path;
+ ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
+ ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
+ }
+
+ void Shutdown() override {
+ ui::ResourceBundle::CleanupSharedInstance();
+ base::TestSuite::Shutdown();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UiArcTestSuite);
+};
+
+} // anonymous namespace
int main(int argc, char** argv) {
- base::TestSuite test_suite(argc, argv);
+ UiArcTestSuite test_suite(argc, argv);
+ gl::GLSurfaceTestSupport::InitializeOneOff();
mojo::edk::Init();
return base::LaunchUnitTests(
argc, argv,
- base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
+ base::Bind(&UiArcTestSuite::Run, base::Unretained(&test_suite)));
}

Powered by Google App Engine
This is Rietveld 408576698