Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / notifications / extension_welcome_notification_unittest.cc
index f3952cc..8dcde90 100644 (file)
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/testing_pref_service_syncable.h"
 #include "chrome/test/base/testing_profile.h"
-#include "components/user_prefs/pref_registry_syncable.h"
+#include "components/pref_registry/pref_registry_syncable.h"
 #include "sync/api/fake_sync_change_processor.h"
 #include "sync/api/sync_error_factory_mock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/message_center/fake_message_center.h"
 #include "ui/message_center/notification.h"
 
-const char kChromeNowExtensionID[] = "pafkbggdmjlpgkdkcbjmhmfcdpncadgh";
-
 class MockMessageCenter : public message_center::FakeMessageCenter {
  public:
   MockMessageCenter()
@@ -40,8 +38,11 @@ class MockMessageCenter : public message_center::FakeMessageCenter {
   }
 
   // message_center::FakeMessageCenter Overrides
-  virtual bool HasNotification(const std::string& id) OVERRIDE {
-    return last_notification.get() && (last_notification->id() == id);
+  virtual message_center::Notification* FindVisibleNotificationById(
+      const std::string& id) OVERRIDE {
+    if (last_notification.get() && last_notification->id() == id)
+      return last_notification.get();
+    return NULL;
   }
 
   virtual void AddNotification(
@@ -137,8 +138,8 @@ class ExtensionWelcomeNotificationTest : public testing::Test {
         new base::ThreadTaskRunnerHandle(task_runner_));
     profile_.reset(new TestingProfile());
     delegate_ = new WelcomeNotificationDelegate();
-    welcome_notification_ = ExtensionWelcomeNotification::Create(
-        kChromeNowExtensionID, profile_.get(), delegate_);
+    welcome_notification_.reset(
+        ExtensionWelcomeNotification::Create(profile_.get(), delegate_));
   }
 
   virtual void TearDown() {
@@ -163,8 +164,9 @@ class ExtensionWelcomeNotificationTest : public testing::Test {
   void ShowChromeNowNotification() const {
     ShowNotification(
         "ChromeNowNotification",
-        message_center::NotifierId(message_center::NotifierId::APPLICATION,
-                                   kChromeNowExtensionID));
+        message_center::NotifierId(
+            message_center::NotifierId::APPLICATION,
+            ExtensionWelcomeNotification::kChromeNowExtensionID));
   }
 
   void ShowRegularNotification() const {