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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 2849633002: Get rid of base::SharedMemory::NULLHandle(); (Closed)
Patch Set: Rebase. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <tuple> 10 #include <tuple>
(...skipping 2851 matching lines...) Expand 10 before | Expand all | Expand 10 after
2862 2862
2863 // Allocate enough bitmaps so that two frames (proportionally) would be 2863 // Allocate enough bitmaps so that two frames (proportionally) would be
2864 // enough hit the handle limit. 2864 // enough hit the handle limit.
2865 int handles_per_frame = 5; 2865 int handles_per_frame = 5;
2866 FrameEvictionManager::GetInstance()->set_max_handles(handles_per_frame * 2); 2866 FrameEvictionManager::GetInstance()->set_max_handles(handles_per_frame * 2);
2867 2867
2868 display_compositor::HostSharedBitmapManagerClient bitmap_client( 2868 display_compositor::HostSharedBitmapManagerClient bitmap_client(
2869 display_compositor::HostSharedBitmapManager::current()); 2869 display_compositor::HostSharedBitmapManager::current());
2870 2870
2871 for (size_t i = 0; i < (renderer_count - 1) * handles_per_frame; i++) { 2871 for (size_t i = 0; i < (renderer_count - 1) * handles_per_frame; i++) {
2872 bitmap_client.ChildAllocatedSharedBitmap( 2872 bitmap_client.ChildAllocatedSharedBitmap(1, base::SharedMemoryHandle(),
2873 1, base::SharedMemory::NULLHandle(), cc::SharedBitmap::GenerateId()); 2873 cc::SharedBitmap::GenerateId());
2874 } 2874 }
2875 2875
2876 // Hiding this last bitmap should evict all but two frames. 2876 // Hiding this last bitmap should evict all but two frames.
2877 views[renderer_count - 1]->Hide(); 2877 views[renderer_count - 1]->Hide();
2878 for (size_t i = 0; i < renderer_count; ++i) { 2878 for (size_t i = 0; i < renderer_count; ++i) {
2879 if (i + 2 < renderer_count) 2879 if (i + 2 < renderer_count)
2880 EXPECT_FALSE(views[i]->HasFrameData()); 2880 EXPECT_FALSE(views[i]->HasFrameData());
2881 else 2881 else
2882 EXPECT_TRUE(views[i]->HasFrameData()); 2882 EXPECT_TRUE(views[i]->HasFrameData());
2883 } 2883 }
(...skipping 2609 matching lines...) Expand 10 before | Expand all | Expand 10 after
5493 // There is no composition in the beginning. 5493 // There is no composition in the beginning.
5494 EXPECT_FALSE(has_composition_text()); 5494 EXPECT_FALSE(has_composition_text());
5495 SetHasCompositionTextToTrue(); 5495 SetHasCompositionTextToTrue();
5496 view->ImeCancelComposition(); 5496 view->ImeCancelComposition();
5497 // The composition must have been canceled. 5497 // The composition must have been canceled.
5498 EXPECT_FALSE(has_composition_text()); 5498 EXPECT_FALSE(has_composition_text());
5499 } 5499 }
5500 } 5500 }
5501 5501
5502 } // namespace content 5502 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_message_filter.cc ('k') | content/renderer/media/audio_message_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698