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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura_browsertest.cc

Issue 307323002: asan: Fix asan leak from r274404. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/web_contents/web_contents_view_aura.h" 5 #include "content/browser/web_contents/web_contents_view_aura.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 13 matching lines...) Expand all
24 #include "content/public/test/browser_test_utils.h" 24 #include "content/public/test/browser_test_utils.h"
25 #include "content/public/test/content_browser_test.h" 25 #include "content/public/test/content_browser_test.h"
26 #include "content/public/test/content_browser_test_utils.h" 26 #include "content/public/test/content_browser_test_utils.h"
27 #include "content/public/test/test_renderer_host.h" 27 #include "content/public/test/test_renderer_host.h"
28 #include "content/public/test/test_utils.h" 28 #include "content/public/test/test_utils.h"
29 #include "content/shell/browser/shell.h" 29 #include "content/shell/browser/shell.h"
30 #include "ui/aura/test/event_generator.h" 30 #include "ui/aura/test/event_generator.h"
31 #include "ui/aura/window.h" 31 #include "ui/aura/window.h"
32 #include "ui/aura/window_tree_host.h" 32 #include "ui/aura/window_tree_host.h"
33 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 33 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
34 #include "ui/compositor/test/draw_waiter_for_test.h"
34 #include "ui/events/event_processor.h" 35 #include "ui/events/event_processor.h"
35 #include "ui/events/event_utils.h" 36 #include "ui/events/event_utils.h"
36 37
37 namespace content { 38 namespace content {
38 39
39 // This class keeps track of the RenderViewHost whose screenshot was captured. 40 // This class keeps track of the RenderViewHost whose screenshot was captured.
40 class ScreenshotTracker : public NavigationEntryScreenshotManager { 41 class ScreenshotTracker : public NavigationEntryScreenshotManager {
41 public: 42 public:
42 explicit ScreenshotTracker(NavigationControllerImpl* controller) 43 explicit ScreenshotTracker(NavigationControllerImpl* controller)
43 : NavigationEntryScreenshotManager(controller), 44 : NavigationEntryScreenshotManager(controller),
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 return index; 256 return index;
256 } 257 }
257 258
258 protected: 259 protected:
259 ScreenshotTracker* screenshot_manager() { return screenshot_manager_; } 260 ScreenshotTracker* screenshot_manager() { return screenshot_manager_; }
260 void set_min_screenshot_interval(int interval_ms) { 261 void set_min_screenshot_interval(int interval_ms) {
261 screenshot_manager_->SetScreenshotInterval(interval_ms); 262 screenshot_manager_->SetScreenshotInterval(interval_ms);
262 } 263 }
263 264
264 private: 265 private:
266 // BrowserTestBase:
267 virtual void TearDownOnMainThread() OVERRIDE {
268 aura::Window* window = shell()->web_contents()->GetNativeView();
269 ui::Compositor* compositor = window->layer()->GetCompositor();
270 while (compositor->layer_animator_collection()->HasActiveAnimators())
271 ui::DrawWaiterForTest::Wait(compositor);
sky 2014/06/03 13:19:15 This seems easy to miss. Who owns these animations
sadrul 2014/06/03 18:35:04 This CL was reverted (along with the original CL).
272 ContentBrowserTest::TearDownOnMainThread();
273 }
274
265 ScreenshotTracker* screenshot_manager_; 275 ScreenshotTracker* screenshot_manager_;
266 276
267 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAuraTest); 277 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAuraTest);
268 }; 278 };
269 279
270 // Flaky on Windows and ChromeOS: http://crbug.com/305722 280 // Flaky on Windows and ChromeOS: http://crbug.com/305722
271 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, 281 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
272 DISABLED_OverscrollNavigation) { 282 DISABLED_OverscrollNavigation) {
273 TestOverscrollNavigation(false); 283 TestOverscrollNavigation(false);
274 } 284 }
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 static_cast<WebContentsImpl*>(shell()->web_contents()); 690 static_cast<WebContentsImpl*>(shell()->web_contents());
681 aura::Window* content = web_contents->GetNativeView()->parent(); 691 aura::Window* content = web_contents->GetNativeView()->parent();
682 EXPECT_TRUE(web_contents->should_normally_be_visible()); 692 EXPECT_TRUE(web_contents->should_normally_be_visible());
683 content->Hide(); 693 content->Hide();
684 EXPECT_FALSE(web_contents->should_normally_be_visible()); 694 EXPECT_FALSE(web_contents->should_normally_be_visible());
685 content->Show(); 695 content->Show();
686 EXPECT_TRUE(web_contents->should_normally_be_visible()); 696 EXPECT_TRUE(web_contents->should_normally_be_visible());
687 } 697 }
688 698
689 } // namespace content 699 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698