Commit b655f88a authored by halliwell's avatar halliwell Committed by Commit bot

Fix RenderWidgetHostViewAuraTest failure on devices with little memory

This test fails (same symptoms as bug 443352) on hardware with <= 256MB
of RAM.

BUG= internal b/21093117

Review URL: https://codereview.chromium.org/1140813005

Cr-Commit-Position: refs/heads/master@{#330541}
parent 5f027e9b
...@@ -2048,10 +2048,14 @@ TEST_F(RenderWidgetHostViewAuraTest, DiscardDelegatedFramesWithLocking) { ...@@ -2048,10 +2048,14 @@ TEST_F(RenderWidgetHostViewAuraTest, DiscardDelegatedFramesWithLocking) {
TEST_F(RenderWidgetHostViewAuraTest, DiscardDelegatedFramesWithMemoryPressure) { TEST_F(RenderWidgetHostViewAuraTest, DiscardDelegatedFramesWithMemoryPressure) {
view_->InitAsChild(NULL); view_->InitAsChild(NULL);
size_t max_renderer_frames = // The test logic below relies on having max_renderer_frames > 2. By default,
RendererFrameManager::GetInstance()->GetMaxNumberOfSavedFrames(); // this value is calculated from total physical memory and causes the test to
ASSERT_LE(2u, max_renderer_frames); // fail when run on hardware with < 256MB of RAM.
size_t renderer_count = max_renderer_frames; const size_t kMaxRendererFrames = 5;
RendererFrameManager::GetInstance()->set_max_number_of_saved_frames(
kMaxRendererFrames);
size_t renderer_count = kMaxRendererFrames;
gfx::Rect view_rect(100, 100); gfx::Rect view_rect(100, 100);
gfx::Size frame_size = view_rect.size(); gfx::Size frame_size = view_rect.size();
DCHECK_EQ(0u, HostSharedBitmapManager::current()->AllocatedBitmapCount()); DCHECK_EQ(0u, HostSharedBitmapManager::current()->AllocatedBitmapCount());
......
...@@ -41,6 +41,9 @@ class CONTENT_EXPORT RendererFrameManager { ...@@ -41,6 +41,9 @@ class CONTENT_EXPORT RendererFrameManager {
size_t GetMaxNumberOfSavedFrames() const; size_t GetMaxNumberOfSavedFrames() const;
// For testing only // For testing only
void set_max_number_of_saved_frames(size_t max_number_of_saved_frames) {
max_number_of_saved_frames_ = max_number_of_saved_frames;
}
void set_max_handles(float max_handles) { max_handles_ = max_handles; } void set_max_handles(float max_handles) { max_handles_ = max_handles; }
private: private:
......
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