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

Side by Side Diff: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc

Issue 1657933003: Fixes the interactive default browser UX for policy setting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: grt comments 2 Created 4 years, 10 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 "chrome/browser/custom_handlers/protocol_handler_registry.h" 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 ShellIntegration::IS_DEFAULT; 234 ShellIntegration::IS_DEFAULT;
235 if (force_failure_) 235 if (force_failure_)
236 state = ShellIntegration::NOT_DEFAULT; 236 state = ShellIntegration::NOT_DEFAULT;
237 237
238 BrowserThread::PostTask( 238 BrowserThread::PostTask(
239 BrowserThread::UI, FROM_HERE, 239 BrowserThread::UI, FROM_HERE,
240 base::Bind(&FakeProtocolClientWorker::OnCheckIsDefaultComplete, this, 240 base::Bind(&FakeProtocolClientWorker::OnCheckIsDefaultComplete, this,
241 state)); 241 state));
242 } 242 }
243 243
244 void SetAsDefault(bool interactive_permitted) override { 244 void SetAsDefault() override {
245 BrowserThread::PostTask( 245 BrowserThread::PostTask(
246 BrowserThread::UI, FROM_HERE, 246 BrowserThread::UI, FROM_HERE,
247 base::Bind(&FakeProtocolClientWorker::OnSetAsDefaultAttemptComplete, 247 base::Bind(&FakeProtocolClientWorker::OnSetAsDefaultAttemptComplete,
248 this, AttemptResult::SUCCESS)); 248 this, AttemptResult::SUCCESS));
249 } 249 }
250 250
251 private: 251 private:
252 bool force_failure_; 252 bool force_failure_;
253 }; 253 };
254 254
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 // added to pref. 1102 // added to pref.
1103 ASSERT_EQ(InPrefIgnoredHandlerCount(), 2); 1103 ASSERT_EQ(InPrefIgnoredHandlerCount(), 2);
1104 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); 1104 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4);
1105 1105
1106 registry()->RemoveIgnoredHandler(p2u1); 1106 registry()->RemoveIgnoredHandler(p2u1);
1107 1107
1108 // p2u1 installed by user and policy, so it is removed from pref alone. 1108 // p2u1 installed by user and policy, so it is removed from pref alone.
1109 ASSERT_EQ(InPrefIgnoredHandlerCount(), 1); 1109 ASSERT_EQ(InPrefIgnoredHandlerCount(), 1);
1110 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); 1110 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4);
1111 } 1111 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698