| 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/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 IN_PROC_BROWSER_TEST_F(ChildProcessSecurityPolicyInProcessBrowserTest, NoLeak) { | 39 IN_PROC_BROWSER_TEST_F(ChildProcessSecurityPolicyInProcessBrowserTest, NoLeak) { |
| 40 const FilePath kTestDir(FILE_PATH_LITERAL("google")); | 40 const FilePath kTestDir(FILE_PATH_LITERAL("google")); |
| 41 const FilePath kTestFile(FILE_PATH_LITERAL("google.html")); | 41 const FilePath kTestFile(FILE_PATH_LITERAL("google.html")); |
| 42 GURL url(ui_test_utils::GetTestUrl(kTestDir, kTestFile)); | 42 GURL url(ui_test_utils::GetTestUrl(kTestDir, kTestFile)); |
| 43 | 43 |
| 44 ui_test_utils::NavigateToURL(browser(), url); | 44 ui_test_utils::NavigateToURL(browser(), url); |
| 45 EXPECT_EQ( | 45 EXPECT_EQ( |
| 46 ChildProcessSecurityPolicyImpl::GetInstance()->security_state_.size(), | 46 ChildProcessSecurityPolicyImpl::GetInstance()->security_state_.size(), |
| 47 1U); | 47 1U); |
| 48 | 48 |
| 49 WebContents* tab = browser()->GetWebContentsAt(0); | 49 WebContents* web_contents = browser()->GetWebContentsAt(0); |
| 50 ASSERT_TRUE(tab != NULL); | 50 ASSERT_TRUE(web_contents != NULL); |
| 51 base::KillProcess(tab->GetRenderProcessHost()->GetHandle(), | 51 base::KillProcess(web_contents->GetRenderProcessHost()->GetHandle(), |
| 52 content::RESULT_CODE_KILLED, true); | 52 content::RESULT_CODE_KILLED, true); |
| 53 | 53 |
| 54 tab->GetController().Reload(true); | 54 web_contents->GetController().Reload(true); |
| 55 EXPECT_EQ( | 55 EXPECT_EQ( |
| 56 ChildProcessSecurityPolicyImpl::GetInstance()->security_state_.size(), | 56 1U, |
| 57 1U); | 57 ChildProcessSecurityPolicyImpl::GetInstance()->security_state_.size()); |
| 58 } | 58 } |
| OLD | NEW |