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

Side by Side Diff: chrome/browser/external_protocol/external_protocol_handler_unittest.cc

Issue 2538353002: fix external protocol handling for OOPIFs (Closed)
Patch Set: remove unnecessary include 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 (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 "chrome/browser/external_protocol/external_protocol_handler.h" 5 #include "chrome/browser/external_protocol/external_protocol_handler.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "content/public/test/test_browser_thread.h" 9 #include "content/public/test/test_browser_thread.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void RunExternalProtocolDialog(const GURL& url, 66 void RunExternalProtocolDialog(const GURL& url,
67 int render_process_host_id, 67 int render_process_host_id,
68 int routing_id, 68 int routing_id,
69 ui::PageTransition page_transition, 69 ui::PageTransition page_transition,
70 bool has_user_gesture) override { 70 bool has_user_gesture) override {
71 ASSERT_EQ(block_state_, ExternalProtocolHandler::UNKNOWN); 71 ASSERT_EQ(block_state_, ExternalProtocolHandler::UNKNOWN);
72 ASSERT_NE(os_state_, shell_integration::IS_DEFAULT); 72 ASSERT_NE(os_state_, shell_integration::IS_DEFAULT);
73 has_prompted_ = true; 73 has_prompted_ = true;
74 } 74 }
75 75
76 void LaunchUrlWithoutSecurityCheck(const GURL& url) override { 76 void LaunchUrlWithoutSecurityCheck(
77 const GURL& url,
78 content::WebContents* web_contents) override {
77 ASSERT_EQ(block_state_, ExternalProtocolHandler::DONT_BLOCK); 79 ASSERT_EQ(block_state_, ExternalProtocolHandler::DONT_BLOCK);
78 ASSERT_NE(os_state_, shell_integration::IS_DEFAULT); 80 ASSERT_NE(os_state_, shell_integration::IS_DEFAULT);
79 has_launched_ = true; 81 has_launched_ = true;
80 } 82 }
81 83
82 void FinishedProcessingCheck() override { 84 void FinishedProcessingCheck() override {
83 base::MessageLoop::current()->QuitWhenIdle(); 85 base::MessageLoop::current()->QuitWhenIdle();
84 } 86 }
85 87
86 void set_os_state(shell_integration::DefaultWebClientState value) { 88 void set_os_state(shell_integration::DefaultWebClientState value) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 184
183 TEST_F(ExternalProtocolHandlerTest, TestLaunchSchemeUnknownChromeNotDefault) { 185 TEST_F(ExternalProtocolHandlerTest, TestLaunchSchemeUnknownChromeNotDefault) {
184 DoTest(ExternalProtocolHandler::UNKNOWN, shell_integration::NOT_DEFAULT, true, 186 DoTest(ExternalProtocolHandler::UNKNOWN, shell_integration::NOT_DEFAULT, true,
185 false, false); 187 false, false);
186 } 188 }
187 189
188 TEST_F(ExternalProtocolHandlerTest, TestLaunchSchemeUnknownChromeUnknown) { 190 TEST_F(ExternalProtocolHandlerTest, TestLaunchSchemeUnknownChromeUnknown) {
189 DoTest(ExternalProtocolHandler::UNKNOWN, shell_integration::UNKNOWN_DEFAULT, 191 DoTest(ExternalProtocolHandler::UNKNOWN, shell_integration::UNKNOWN_DEFAULT,
190 true, false, false); 192 true, false, false);
191 } 193 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698