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

Unified Diff: ui/android/resources/resource_manager_impl_unittest.cc

Issue 1578353002: Pull the Activity context from WindowAndroid if possible (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@2564
Patch Set: Created 4 years, 11 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 | « ui/android/resources/resource_manager_impl.cc ('k') | ui/android/window_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/resources/resource_manager_impl_unittest.cc
diff --git a/ui/android/resources/resource_manager_impl_unittest.cc b/ui/android/resources/resource_manager_impl_unittest.cc
index dbf2e65a1b81be537a07e550d05bb658158dfb43..fd57f7057bd187a97b183d3df22a308e830436d9 100644
--- a/ui/android/resources/resource_manager_impl_unittest.cc
+++ b/ui/android/resources/resource_manager_impl_unittest.cc
@@ -12,6 +12,7 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/android/resources/resource_manager_impl.h"
#include "ui/android/resources/system_ui_resource_type.h"
+#include "ui/android/window_android.h"
#include "ui/gfx/android/java_bitmap.h"
@@ -34,7 +35,9 @@ namespace ui {
class TestResourceManagerImpl : public ResourceManagerImpl {
public:
- TestResourceManagerImpl() {}
+ TestResourceManagerImpl(WindowAndroid* window_android)
+ : ResourceManagerImpl(window_android) {}
+
~TestResourceManagerImpl() override {}
void SetResourceAsLoaded(AndroidResourceType res_type, int res_id) {
@@ -80,7 +83,10 @@ class MockLayerTreeHost : public cc::LayerTreeHost {
class ResourceManagerTest : public testing::Test {
public:
- ResourceManagerTest() : fake_client_(cc::FakeLayerTreeHostClient::DIRECT_3D) {
+ ResourceManagerTest()
+ : window_android_(WindowAndroid::createForTesting()),
+ resource_manager_(window_android_),
+ fake_client_(cc::FakeLayerTreeHostClient::DIRECT_3D) {
cc::LayerTreeHost::InitParams params;
cc::LayerTreeSettings settings;
params.client = &fake_client_;
@@ -90,6 +96,8 @@ class ResourceManagerTest : public testing::Test {
resource_manager_.Init(host_.get());
}
+ ~ResourceManagerTest() override { window_android_->Destroy(NULL, NULL); }
+
void PreloadResource(ui::SystemUIResourceType type) {
resource_manager_.PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM, type);
}
@@ -104,6 +112,9 @@ class ResourceManagerTest : public testing::Test {
type);
}
+ private:
+ WindowAndroid* window_android_;
+
protected:
scoped_ptr<MockLayerTreeHost> host_;
TestResourceManagerImpl resource_manager_;
« no previous file with comments | « ui/android/resources/resource_manager_impl.cc ('k') | ui/android/window_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698