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

Side by Side Diff: chrome/browser/extensions/extension_gcm_app_handler_unittest.cc

Issue 597683005: GCM: D-Bus methods for wake-on-packet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolved DEPS conflict Created 6 years, 3 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 | chrome/browser/services/gcm/chromeos_gcm_connection_observer.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_gcm_app_handler.h" 5 #include "chrome/browser/extensions/extension_gcm_app_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "extensions/common/manifest.h" 49 #include "extensions/common/manifest.h"
50 #include "extensions/common/manifest_constants.h" 50 #include "extensions/common/manifest_constants.h"
51 #include "extensions/common/permissions/api_permission.h" 51 #include "extensions/common/permissions/api_permission.h"
52 #include "extensions/common/permissions/permissions_data.h" 52 #include "extensions/common/permissions/permissions_data.h"
53 #include "testing/gtest/include/gtest/gtest.h" 53 #include "testing/gtest/include/gtest/gtest.h"
54 54
55 #if defined(OS_CHROMEOS) 55 #if defined(OS_CHROMEOS)
56 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h" 56 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
57 #include "chrome/browser/chromeos/settings/cros_settings.h" 57 #include "chrome/browser/chromeos/settings/cros_settings.h"
58 #include "chrome/browser/chromeos/settings/device_settings_service.h" 58 #include "chrome/browser/chromeos/settings/device_settings_service.h"
59 #include "chromeos/dbus/dbus_thread_manager.h"
59 #endif 60 #endif
60 61
61 namespace extensions { 62 namespace extensions {
62 63
63 namespace { 64 namespace {
64 65
65 const char kTestExtensionName[] = "FooBar"; 66 const char kTestExtensionName[] = "FooBar";
66 const char kTestingUsername[] = "user1@example.com"; 67 const char kTestingUsername[] = "user1@example.com";
67 68
68 } // namespace 69 } // namespace
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 thread_bundle_.reset(new content::TestBrowserThreadBundle( 214 thread_bundle_.reset(new content::TestBrowserThreadBundle(
214 content::TestBrowserThreadBundle::REAL_IO_THREAD)); 215 content::TestBrowserThreadBundle::REAL_IO_THREAD));
215 216
216 // Allow extension update to unpack crx in process. 217 // Allow extension update to unpack crx in process.
217 in_process_utility_thread_helper_.reset( 218 in_process_utility_thread_helper_.reset(
218 new content::InProcessUtilityThreadHelper); 219 new content::InProcessUtilityThreadHelper);
219 220
220 // This is needed to create extension service under CrOS. 221 // This is needed to create extension service under CrOS.
221 #if defined(OS_CHROMEOS) 222 #if defined(OS_CHROMEOS)
222 test_user_manager_.reset(new chromeos::ScopedTestUserManager()); 223 test_user_manager_.reset(new chromeos::ScopedTestUserManager());
224 // Creating a DBus thread manager setter has the side effect of
225 // creating a DBusThreadManager, which is needed for testing.
226 // We don't actually need the setter so we ignore the return value.
227 chromeos::DBusThreadManager::GetSetterForTesting();
223 #endif 228 #endif
224 229
225 // Create a new profile. 230 // Create a new profile.
226 TestingProfile::Builder builder; 231 TestingProfile::Builder builder;
227 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), 232 builder.AddTestingFactory(SigninManagerFactory::GetInstance(),
228 gcm::FakeSigninManager::Build); 233 gcm::FakeSigninManager::Build);
229 profile_ = builder.Build(); 234 profile_ = builder.Build();
230 signin_manager_ = static_cast<gcm::FakeSigninManager*>( 235 signin_manager_ = static_cast<gcm::FakeSigninManager*>(
231 SigninManagerFactory::GetInstance()->GetForProfile(profile_.get())); 236 SigninManagerFactory::GetInstance()->GetForProfile(profile_.get()));
232 237
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 490
486 // App handler is removed when the extension is updated to the version that 491 // App handler is removed when the extension is updated to the version that
487 // has GCM permission removed. 492 // has GCM permission removed.
488 UpdateExtension(extension.get(), "good2.crx"); 493 UpdateExtension(extension.get(), "good2.crx");
489 waiter()->PumpUILoop(); 494 waiter()->PumpUILoop();
490 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); 495 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero());
491 EXPECT_FALSE(HasAppHandlers(extension->id())); 496 EXPECT_FALSE(HasAppHandlers(extension->id()));
492 } 497 }
493 498
494 } // namespace extensions 499 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/services/gcm/chromeos_gcm_connection_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698