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

Side by Side Diff: components/web_cache/browser/web_cache_manager_browsertest.cc

Issue 528363002: Move webCacheManager to //components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small changes are made. Created 6 years, 3 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 <string> 5 #include <string>
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
erikwright (departed) 2014/09/08 18:17:49 How hard is it going to be to fix the chrome DEP f
Xi Han 2014/09/08 18:52:23 Honestly, I really can't foresee when these chrome
8 #include "chrome/browser/renderer_host/web_cache_manager.h"
9 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
12 #include "chrome/test/base/in_process_browser_test.h" 11 #include "chrome/test/base/in_process_browser_test.h"
13 #include "chrome/test/base/ui_test_utils.h" 12 #include "chrome/test/base/ui_test_utils.h"
13 #include "components/web_cache/browser/web_cache_manager.h"
14 #include "content/public/browser/render_process_host.h" 14 #include "content/public/browser/render_process_host.h"
15 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
16 #include "content/public/common/result_codes.h" 16 #include "content/public/common/result_codes.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 using content::WebContents; 19 using content::WebContents;
20 20
21 namespace web_cache {
22
21 class WebCacheManagerBrowserTest : public InProcessBrowserTest { 23 class WebCacheManagerBrowserTest : public InProcessBrowserTest {
22 }; 24 };
23 25
24 // Regression test for http://crbug.com/12362. If a renderer crashes and the 26 // Regression test for http://crbug.com/12362. If a renderer crashes and the
25 // user navigates to another tab and back, the browser doesn't crash. 27 // user navigates to another tab and back, the browser doesn't crash.
26 IN_PROC_BROWSER_TEST_F(WebCacheManagerBrowserTest, CrashOnceOnly) { 28 IN_PROC_BROWSER_TEST_F(WebCacheManagerBrowserTest, CrashOnceOnly) {
27 const base::FilePath kTestDir(FILE_PATH_LITERAL("google")); 29 const base::FilePath kTestDir(FILE_PATH_LITERAL("google"));
28 const base::FilePath kTestFile(FILE_PATH_LITERAL("google.html")); 30 const base::FilePath kTestFile(FILE_PATH_LITERAL("google.html"));
29 GURL url(ui_test_utils::GetTestUrl(kTestDir, kTestFile)); 31 GURL url(ui_test_utils::GetTestUrl(kTestDir, kTestFile));
30 32
(...skipping 29 matching lines...) Expand all
60 // Depending on the speed of execution of the unload event, we may have one or 62 // Depending on the speed of execution of the unload event, we may have one or
61 // two active renderers at that point (one executing the unload event in 63 // two active renderers at that point (one executing the unload event in
62 // background). 64 // background).
63 EXPECT_GE(WebCacheManager::GetInstance()->active_renderers_.size(), 1U); 65 EXPECT_GE(WebCacheManager::GetInstance()->active_renderers_.size(), 1U);
64 EXPECT_LE(WebCacheManager::GetInstance()->active_renderers_.size(), 2U); 66 EXPECT_LE(WebCacheManager::GetInstance()->active_renderers_.size(), 2U);
65 EXPECT_EQ( 67 EXPECT_EQ(
66 WebCacheManager::GetInstance()->inactive_renderers_.size(), 0U); 68 WebCacheManager::GetInstance()->inactive_renderers_.size(), 0U);
67 EXPECT_GE(WebCacheManager::GetInstance()->stats_.size(), 1U); 69 EXPECT_GE(WebCacheManager::GetInstance()->stats_.size(), 1U);
68 EXPECT_LE(WebCacheManager::GetInstance()->stats_.size(), 2U); 70 EXPECT_LE(WebCacheManager::GetInstance()->stats_.size(), 2U);
69 } 71 }
72
73 } // namespace web_cache
OLDNEW
« no previous file with comments | « components/web_cache/browser/web_cache_manager.cc ('k') | components/web_cache/browser/web_cache_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698