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

Side by Side Diff: chrome/browser/extensions/api/notifications/notifications_apitest.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 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
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 "base/strings/string_number_conversions.h" 5 #include "base/strings/string_number_conversions.h"
6 #include "base/strings/stringprintf.h" 6 #include "base/strings/stringprintf.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/extensions/api/notifications/notifications_api.h" 9 #include "chrome/browser/extensions/api/notifications/notifications_api.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, 90 extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
91 content::NotificationService::AllSources()); 91 content::NotificationService::AllSources());
92 const extensions::Extension* extension = LoadExtension(extdir); 92 const extensions::Extension* extension = LoadExtension(extdir);
93 if (extension) { 93 if (extension) {
94 page_created.Wait(); 94 page_created.Wait();
95 } 95 }
96 return extension; 96 return extension;
97 } 97 }
98 98
99 protected: 99 protected:
100 std::string GetNotificationIdFromDelegateId(std::string delegate_id) { 100 std::string GetNotificationIdFromDelegateId(const std::string& delegate_id) {
101 return g_browser_process->notification_ui_manager() 101 return g_browser_process->notification_ui_manager()
102 ->FindById( 102 ->FindById(
103 delegate_id, 103 delegate_id,
104 NotificationUIManager::GetProfileID( 104 NotificationUIManager::GetProfileID(
105 g_browser_process->profile_manager()->GetLastUsedProfile())) 105 g_browser_process->profile_manager()->GetLastUsedProfile()))
106 ->id(); 106 ->id();
107 } 107 }
108 }; 108 };
109 109
110 } // namespace 110 } // namespace
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 notification->ButtonClick(0); 282 notification->ButtonClick(0);
283 EXPECT_TRUE(catcher.GetNextResult()); 283 EXPECT_TRUE(catcher.GetNextResult());
284 notification->Click(); 284 notification->Click();
285 EXPECT_TRUE(catcher.GetNextResult()); 285 EXPECT_TRUE(catcher.GetNextResult());
286 notification->Close(true); 286 notification->Close(true);
287 EXPECT_TRUE(catcher.GetNextResult()); 287 EXPECT_TRUE(catcher.GetNextResult());
288 notification->Close(false); 288 notification->Close(false);
289 EXPECT_FALSE(catcher.GetNextResult()); 289 EXPECT_FALSE(catcher.GetNextResult());
290 } 290 }
291 } 291 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698