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

Side by Side Diff: chrome/browser/permissions/permissions_browsertest.cc

Issue 2590363003: [HBD] Intercept Flash navigations in popup windows. (Closed)
Patch Set: Ad dtest Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/permissions/permissions_browsertest.h" 5 #include "chrome/browser/permissions/permissions_browsertest.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/permissions/permission_request_manager.h" 8 #include "chrome/browser/permissions/permission_request_manager.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 16 matching lines...) Expand all
27 browser()->tab_strip_model()->GetActiveWebContents()); 27 browser()->tab_strip_model()->GetActiveWebContents());
28 prompt_factory_.reset(new MockPermissionPromptFactory(manager)); 28 prompt_factory_.reset(new MockPermissionPromptFactory(manager));
29 manager->DisplayPendingRequests(); 29 manager->DisplayPendingRequests();
30 30
31 ASSERT_TRUE(embedded_test_server()->Start()); 31 ASSERT_TRUE(embedded_test_server()->Start());
32 32
33 ui_test_utils::NavigateToURL(browser(), 33 ui_test_utils::NavigateToURL(browser(),
34 embedded_test_server()->GetURL(test_url())); 34 embedded_test_server()->GetURL(test_url()));
35 } 35 }
36 36
37 void PermissionsBrowserTest::TearDownOnMainThread() {
38 prompt_factory_.reset();
tommycli 2016/12/21 00:20:45 I had to remove this, because otherwise I got the
39
40 InProcessBrowserTest::TearDownOnMainThread();
41 }
42
43 bool PermissionsBrowserTest::RunScriptReturnBool(const std::string& script) { 37 bool PermissionsBrowserTest::RunScriptReturnBool(const std::string& script) {
44 bool result; 38 bool result;
45 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( 39 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
46 GetWebContents()->GetMainFrame(), script, &result)); 40 GetWebContents()->GetMainFrame(), script, &result));
47 return result; 41 return result;
48 } 42 }
49 43
50 content::WebContents* PermissionsBrowserTest::GetWebContents() { 44 content::WebContents* PermissionsBrowserTest::GetWebContents() {
51 return browser()->tab_strip_model()->GetActiveWebContents(); 45 return browser()->tab_strip_model()->GetActiveWebContents();
52 } 46 }
(...skipping 24 matching lines...) Expand all
77 } 71 }
78 72
79 void PermissionsBrowserTest::CommonSucceedsIfAllowed() { 73 void PermissionsBrowserTest::CommonSucceedsIfAllowed() {
80 EXPECT_EQ(0, prompt_factory()->total_request_count()); 74 EXPECT_EQ(0, prompt_factory()->total_request_count());
81 prompt_factory()->set_response_type(PermissionRequestManager::ACCEPT_ALL); 75 prompt_factory()->set_response_type(PermissionRequestManager::ACCEPT_ALL);
82 TriggerPrompt(); 76 TriggerPrompt();
83 77
84 EXPECT_TRUE(FeatureUsageSucceeds()); 78 EXPECT_TRUE(FeatureUsageSucceeds());
85 EXPECT_EQ(1, prompt_factory()->total_request_count()); 79 EXPECT_EQ(1, prompt_factory()->total_request_count());
86 } 80 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permissions_browsertest.h ('k') | chrome/browser/plugins/flash_download_interception.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698