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

Side by Side Diff: chrome/browser/renderer_host/web_cache_manager_browsertest.cc

Issue 88503002: Have the unload event execute in background on cross-site navigations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unit tests Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 <string> 5 #include <string>
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "chrome/browser/renderer_host/web_cache_manager.h" 8 #include "chrome/browser/renderer_host/web_cache_manager.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_commands.h" 10 #include "chrome/browser/ui/browser_commands.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 browser()->tab_strip_model()->ActivateTabAt(0, true); 51 browser()->tab_strip_model()->ActivateTabAt(0, true);
52 chrome::CloseTab(browser()); 52 chrome::CloseTab(browser());
53 browser()->tab_strip_model()->ActivateTabAt(0, true); 53 browser()->tab_strip_model()->ActivateTabAt(0, true);
54 chrome::CloseTab(browser()); 54 chrome::CloseTab(browser());
55 browser()->tab_strip_model()->ActivateTabAt(0, true); 55 browser()->tab_strip_model()->ActivateTabAt(0, true);
56 chrome::CloseTab(browser()); 56 chrome::CloseTab(browser());
57 57
58 ui_test_utils::NavigateToURL(browser(), url); 58 ui_test_utils::NavigateToURL(browser(), url);
59 59
60 EXPECT_EQ( 60 // Depending on the speed of execution of the unload event, we may have one or
61 WebCacheManager::GetInstance()->active_renderers_.size(), 1U); 61 // two active renderers at that point (one executing the unload event in
62 // background).
63 EXPECT_GE(WebCacheManager::GetInstance()->active_renderers_.size(), 1U);
64 EXPECT_LE(WebCacheManager::GetInstance()->active_renderers_.size(), 2U);
62 EXPECT_EQ( 65 EXPECT_EQ(
63 WebCacheManager::GetInstance()->inactive_renderers_.size(), 0U); 66 WebCacheManager::GetInstance()->inactive_renderers_.size(), 0U);
64 EXPECT_EQ( 67 EXPECT_GE(WebCacheManager::GetInstance()->stats_.size(), 1U);
65 WebCacheManager::GetInstance()->stats_.size(), 1U); 68 EXPECT_LE(WebCacheManager::GetInstance()->stats_.size(), 2U);
66 } 69 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/base/browser_with_test_window_test.cc » ('j') | chrome/test/base/browser_with_test_window_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698