OLD | NEW |
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 "chrome/browser/extensions/api/notification/notification_api.h" | 5 #include "chrome/browser/extensions/api/notification/notification_api.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chrome/browser/extensions/extension_function_test_utils.h" | 7 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 8 #include "chrome/common/chrome_switches.h" |
8 | 9 |
9 using extensions::Extension; | 10 using extensions::Extension; |
10 | 11 |
11 namespace utils = extension_function_test_utils; | 12 namespace utils = extension_function_test_utils; |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 class NotificationApiTest : public PlatformAppApiTest { | 16 class NotificationApiTest : public ExtensionApiTest { |
| 17 public: |
| 18 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 19 ExtensionApiTest::SetUpCommandLine(command_line); |
| 20 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
| 21 } |
16 }; | 22 }; |
17 | 23 |
18 } // namespace | 24 } // namespace |
19 | 25 |
20 IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestNothing) { | 26 IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestNothing) { |
21 scoped_refptr<extensions::NotificationShowFunction> | 27 scoped_refptr<extensions::NotificationShowFunction> |
22 notification_show_function(new extensions::NotificationShowFunction()); | 28 notification_show_function(new extensions::NotificationShowFunction()); |
23 scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension()); | 29 scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension()); |
24 | 30 |
25 notification_show_function->set_extension(empty_extension.get()); | 31 notification_show_function->set_extension(empty_extension.get()); |
26 notification_show_function->set_has_callback(true); | 32 notification_show_function->set_has_callback(true); |
27 | 33 |
28 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( | 34 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
29 notification_show_function, | 35 notification_show_function, |
30 "[{\"text\": \"Check out Cirque du Soleil\"}]", | 36 "[{\"text\": \"Check out Cirque du Soleil\"}]", |
31 browser(), utils::NONE)); | 37 browser(), utils::NONE)); |
32 ASSERT_EQ(base::Value::TYPE_BOOLEAN, result->GetType()); | 38 ASSERT_EQ(base::Value::TYPE_BOOLEAN, result->GetType()); |
33 } | 39 } |
OLD | NEW |