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

Side by Side Diff: chrome/browser/background/background_contents_service_unittest.cc

Issue 1086733002: Ensure tests have an active task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reduce to test fixes only. Created 5 years, 8 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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 std::string GetPrefURLForApp(Profile* profile, const base::string16& appid) { 55 std::string GetPrefURLForApp(Profile* profile, const base::string16& appid) {
56 const base::DictionaryValue* pref = GetPrefs(profile); 56 const base::DictionaryValue* pref = GetPrefs(profile);
57 EXPECT_TRUE(pref->HasKey(base::UTF16ToUTF8(appid))); 57 EXPECT_TRUE(pref->HasKey(base::UTF16ToUTF8(appid)));
58 const base::DictionaryValue* value; 58 const base::DictionaryValue* value;
59 pref->GetDictionaryWithoutPathExpansion(base::UTF16ToUTF8(appid), &value); 59 pref->GetDictionaryWithoutPathExpansion(base::UTF16ToUTF8(appid), &value);
60 std::string url; 60 std::string url;
61 value->GetString("url", &url); 61 value->GetString("url", &url);
62 return url; 62 return url;
63 } 63 }
64 64
65 base::MessageLoop message_loop_;
65 scoped_ptr<base::CommandLine> command_line_; 66 scoped_ptr<base::CommandLine> command_line_;
66 }; 67 };
67 68
68 class MockBackgroundContents : public BackgroundContents { 69 class MockBackgroundContents : public BackgroundContents {
69 public: 70 public:
70 explicit MockBackgroundContents(Profile* profile) 71 explicit MockBackgroundContents(Profile* profile)
71 : appid_(base::ASCIIToUTF16("app_id")), 72 : appid_(base::ASCIIToUTF16("app_id")),
72 profile_(profile) { 73 profile_(profile) {
73 } 74 }
74 MockBackgroundContents(Profile* profile, const std::string& id) 75 MockBackgroundContents(Profile* profile, const std::string& id)
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 CreateCrashNotification(extension); 386 CreateCrashNotification(extension);
386 CreateCrashNotification(extension); 387 CreateCrashNotification(extension);
387 388
388 message_center::MessageCenter* message_center = 389 message_center::MessageCenter* message_center =
389 message_center::MessageCenter::Get(); 390 message_center::MessageCenter::Get();
390 message_center::NotificationList::Notifications notifications = 391 message_center::NotificationList::Notifications notifications =
391 message_center->GetVisibleNotifications(); 392 message_center->GetVisibleNotifications();
392 ASSERT_EQ(1u, notifications.size()); 393 ASSERT_EQ(1u, notifications.size());
393 } 394 }
394 #endif 395 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698