OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 4541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4552 } | 4552 } |
4553 | 4553 |
4554 class ExtensionCookieCallback { | 4554 class ExtensionCookieCallback { |
4555 public: | 4555 public: |
4556 ExtensionCookieCallback() | 4556 ExtensionCookieCallback() |
4557 : result_(false), | 4557 : result_(false), |
4558 weak_factory_(base::MessageLoop::current()) {} | 4558 weak_factory_(base::MessageLoop::current()) {} |
4559 | 4559 |
4560 void SetCookieCallback(bool result) { | 4560 void SetCookieCallback(bool result) { |
4561 base::ThreadTaskRunnerHandle::Get()->PostTask( | 4561 base::ThreadTaskRunnerHandle::Get()->PostTask( |
4562 FROM_HERE, base::Bind(&base::MessageLoop::QuitWhenIdle, | 4562 FROM_HERE, base::BindOnce(&base::MessageLoop::QuitWhenIdle, |
4563 weak_factory_.GetWeakPtr())); | 4563 weak_factory_.GetWeakPtr())); |
4564 result_ = result; | 4564 result_ = result; |
4565 } | 4565 } |
4566 | 4566 |
4567 void GetAllCookiesCallback(const net::CookieList& list) { | 4567 void GetAllCookiesCallback(const net::CookieList& list) { |
4568 base::ThreadTaskRunnerHandle::Get()->PostTask( | 4568 base::ThreadTaskRunnerHandle::Get()->PostTask( |
4569 FROM_HERE, base::Bind(&base::MessageLoop::QuitWhenIdle, | 4569 FROM_HERE, base::BindOnce(&base::MessageLoop::QuitWhenIdle, |
4570 weak_factory_.GetWeakPtr())); | 4570 weak_factory_.GetWeakPtr())); |
4571 list_ = list; | 4571 list_ = list; |
4572 } | 4572 } |
4573 net::CookieList list_; | 4573 net::CookieList list_; |
4574 bool result_; | 4574 bool result_; |
4575 base::WeakPtrFactory<base::MessageLoop> weak_factory_; | 4575 base::WeakPtrFactory<base::MessageLoop> weak_factory_; |
4576 }; | 4576 }; |
4577 | 4577 |
4578 // Verifies extension state is removed upon uninstall. | 4578 // Verifies extension state is removed upon uninstall. |
4579 TEST_F(ExtensionServiceTest, ClearExtensionData) { | 4579 TEST_F(ExtensionServiceTest, ClearExtensionData) { |
4580 InitializeEmptyExtensionService(); | 4580 InitializeEmptyExtensionService(); |
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6958 shared_module->manifest()->type()); | 6958 shared_module->manifest()->type()); |
6959 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); | 6959 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); |
6960 | 6960 |
6961 // Reload the extension and wait for it to complete. This previously crashed | 6961 // Reload the extension and wait for it to complete. This previously crashed |
6962 // (see crbug.com/676815). | 6962 // (see crbug.com/676815). |
6963 service()->ReloadExtension(kExtensionId); | 6963 service()->ReloadExtension(kExtensionId); |
6964 base::RunLoop().RunUntilIdle(); | 6964 base::RunLoop().RunUntilIdle(); |
6965 // The shared module should be enabled. | 6965 // The shared module should be enabled. |
6966 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); | 6966 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); |
6967 } | 6967 } |
OLD | NEW |