Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / notifications / sync_notifier / chrome_notifier_service_unittest.cc
index 5dddca5..acb657c 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <map>
 
+#include "base/command_line.h"
 #include "base/gtest_prod_util.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/prefs/pref_service.h"
@@ -17,6 +18,7 @@
 #include "chrome/browser/notifications/sync_notifier/synced_notification.h"
 #include "chrome/browser/prefs/browser_prefs.h"
 #include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_switches.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/testing_pref_service_syncable.h"
 #include "chrome/test/base/testing_profile.h"
@@ -134,6 +136,12 @@ class ChromeNotifierServiceTest : public testing::Test {
 
   // Methods from testing::Test.
   virtual void SetUp() {
+    // These tests rely on synced notifications being active.  Some testers
+    // report the channel as STABLE so we need to manually enable it.
+    // See crbug.com/338426 for details.
+    CommandLine::ForCurrentProcess()->AppendSwitch(
+        switches::kEnableSyncSyncedNotifications);
+
     // Prevent test code from trying to go to the network.
     ChromeNotifierService::set_avoid_bitmap_fetching_for_test(true);
     notification_manager_.reset(new StubNotificationUIManager(GURL(
@@ -579,7 +587,13 @@ TEST_F(ChromeNotifierServiceTest, ServiceEnabledTest) {
 
 }
 
-TEST_F(ChromeNotifierServiceTest, AddNewSendingServicesTest) {
+// http://crbug.com/341326
+#if defined(TOOLKIT_GTK)
+#define MAYBE_AddNewSendingServicesTest DISABLED_AddNewSendingServicesTest
+#else
+#define MAYBE_AddNewSendingServicesTest AddNewSendingServicesTest
+#endif
+TEST_F(ChromeNotifierServiceTest, MAYBE_AddNewSendingServicesTest) {
   // This test will see if we get a new sending service after the first
   // notification for that service.
   ChromeNotifierService notifier(profile_.get(), notification_manager());