Commit 2df61399 authored by Qiang Xu's avatar Qiang Xu Committed by Commit Bot

app_list: create a single Env instance for app_list_unittests

Bug: 740321
TEST: covered by tests and the issue in crbug.com/740321 can be solved.
Change-Id: I9ff64cde700bc280efda6f27fdf8dc6acac4faa7
Reviewed-on: https://chromium-review.googlesource.com/564317Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Qiang(Joe) Xu <warx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485413}
parent aaed3d66
......@@ -13,6 +13,7 @@
#include "build/build_config.h"
#include "mojo/edk/embedder/embedder.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/env.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/gl/test/gl_surface_test_support.h"
......@@ -32,8 +33,9 @@ class AppListTestSuite : public base::TestSuite {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
command_line->AppendSwitchASCII(kTestType, "applist");
gl::GLSurfaceTestSupport::InitializeOneOff();
base::TestSuite::Initialize();
gl::GLSurfaceTestSupport::InitializeOneOff();
env_ = aura::Env::CreateInstance();
ui::RegisterPathProvider();
base::FilePath ui_test_pak_path;
......@@ -45,11 +47,13 @@ class AppListTestSuite : public base::TestSuite {
}
void Shutdown() override {
env_.reset();
ui::ResourceBundle::CleanupSharedInstance();
base::TestSuite::Shutdown();
}
private:
std::unique_ptr<aura::Env> env_;
base::TestDiscardableMemoryAllocator discardable_memory_allocator_;
DISALLOW_COPY_AND_ASSIGN(AppListTestSuite);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment