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

Side by Side Diff: chrome/browser/extensions/api/vpn_provider/vpn_provider_apitest.cc

Issue 1028213002: Destroy configurations created by VPN extension on disable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes comments from Philipp Created 5 years, 9 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
« no previous file with comments | « no previous file | extensions/browser/api/vpn_provider/vpn_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/strings/string_number_conversions.h" 5 #include "base/strings/string_number_conversions.h"
6 #include "chrome/browser/chromeos/profiles/profile_helper.h" 6 #include "chrome/browser/chromeos/profiles/profile_helper.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chromeos/dbus/dbus_thread_manager.h" 9 #include "chromeos/dbus/dbus_thread_manager.h"
10 #include "chromeos/dbus/fake_shill_profile_client.h" 10 #include "chromeos/dbus/fake_shill_profile_client.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 UninstallExtension(extension_id_); 412 UninstallExtension(extension_id_);
413 content::RunAllPendingInMessageLoop(); 413 content::RunAllPendingInMessageLoop();
414 EXPECT_FALSE(DoesConfigExist(kTestConfig)); 414 EXPECT_FALSE(DoesConfigExist(kTestConfig));
415 EXPECT_FALSE(DBusThreadManager::Get() 415 EXPECT_FALSE(DBusThreadManager::Get()
416 ->GetShillProfileClient() 416 ->GetShillProfileClient()
417 ->GetTestInterface() 417 ->GetTestInterface()
418 ->GetService(service_path, &profile_path, &properties)); 418 ->GetService(service_path, &profile_path, &properties));
419 } 419 }
420 420
421 IN_PROC_BROWSER_TEST_F(VpnProviderApiTest, CreateDisable) {
422 LoadVpnExtension();
423 AddNetworkProfileForUser();
424 EXPECT_TRUE(RunExtensionTest("createConfigSuccess"));
425 EXPECT_TRUE(DoesConfigExist(kTestConfig));
426
427 const std::string service_path = GetSingleServicePath();
428 std::string profile_path;
429 base::DictionaryValue properties;
430 EXPECT_TRUE(DBusThreadManager::Get()
431 ->GetShillProfileClient()
432 ->GetTestInterface()
433 ->GetService(service_path, &profile_path, &properties));
434
435 ExtensionService* extension_service =
436 extensions::ExtensionSystem::Get(profile())->extension_service();
437 extension_service->DisableExtension(extension_id_,
438 extensions::Extension::DISABLE_NONE);
439 content::RunAllPendingInMessageLoop();
440 EXPECT_FALSE(DoesConfigExist(kTestConfig));
441 EXPECT_FALSE(DBusThreadManager::Get()
442 ->GetShillProfileClient()
443 ->GetTestInterface()
444 ->GetService(service_path, &profile_path, &properties));
445 }
446
447 IN_PROC_BROWSER_TEST_F(VpnProviderApiTest, CreateBlacklist) {
448 LoadVpnExtension();
449 AddNetworkProfileForUser();
450 EXPECT_TRUE(RunExtensionTest("createConfigSuccess"));
451 EXPECT_TRUE(DoesConfigExist(kTestConfig));
452
453 const std::string service_path = GetSingleServicePath();
454 std::string profile_path;
455 base::DictionaryValue properties;
456 EXPECT_TRUE(DBusThreadManager::Get()
457 ->GetShillProfileClient()
458 ->GetTestInterface()
459 ->GetService(service_path, &profile_path, &properties));
460
461 ExtensionService* extension_service =
462 extensions::ExtensionSystem::Get(profile())->extension_service();
463 extension_service->BlacklistExtensionForTest(extension_id_);
464 content::RunAllPendingInMessageLoop();
465 EXPECT_FALSE(DoesConfigExist(kTestConfig));
466 EXPECT_FALSE(DBusThreadManager::Get()
467 ->GetShillProfileClient()
468 ->GetTestInterface()
469 ->GetService(service_path, &profile_path, &properties));
470 }
471
421 } // namespace chromeos 472 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/vpn_provider/vpn_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698