OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |