OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 PlatformNotificationServiceBrowserTest::PlatformNotificationServiceBrowserTest() | 106 PlatformNotificationServiceBrowserTest::PlatformNotificationServiceBrowserTest() |
107 : server_root_(FILE_PATH_LITERAL("chrome/test/data")), | 107 : server_root_(FILE_PATH_LITERAL("chrome/test/data")), |
108 // The test server has a base directory that doesn't exist in the | 108 // The test server has a base directory that doesn't exist in the |
109 // filesystem. | 109 // filesystem. |
110 test_page_url_(std::string("/") + kTestFileName) {} | 110 test_page_url_(std::string("/") + kTestFileName) {} |
111 | 111 |
112 void PlatformNotificationServiceBrowserTest::SetUpCommandLine( | 112 void PlatformNotificationServiceBrowserTest::SetUpCommandLine( |
113 base::CommandLine* command_line) { | 113 base::CommandLine* command_line) { |
114 command_line->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures); | 114 command_line->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures); |
115 command_line->AppendSwitch(switches::kEnableNotificationActionIcons); | |
116 | 115 |
117 InProcessBrowserTest::SetUpCommandLine(command_line); | 116 InProcessBrowserTest::SetUpCommandLine(command_line); |
118 } | 117 } |
119 | 118 |
120 void PlatformNotificationServiceBrowserTest::SetUp() { | 119 void PlatformNotificationServiceBrowserTest::SetUp() { |
121 ui_manager_.reset(new StubNotificationUIManager); | 120 ui_manager_.reset(new StubNotificationUIManager); |
122 https_server_.reset( | 121 https_server_.reset( |
123 new net::EmbeddedTestServer(net::EmbeddedTestServer::TYPE_HTTPS)); | 122 new net::EmbeddedTestServer(net::EmbeddedTestServer::TYPE_HTTPS)); |
124 https_server_->ServeFilesFromSourceDirectory(server_root_); | 123 https_server_->ServeFilesFromSourceDirectory(server_root_); |
125 ASSERT_TRUE(https_server_->Start()); | 124 ASSERT_TRUE(https_server_->Start()); |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 EXPECT_EQ("actionTitle2", base::UTF16ToUTF8(notification.buttons()[1].title)); | 490 EXPECT_EQ("actionTitle2", base::UTF16ToUTF8(notification.buttons()[1].title)); |
492 | 491 |
493 notification.delegate()->ButtonClick(0); | 492 notification.delegate()->ButtonClick(0); |
494 ASSERT_TRUE(RunScript("GetMessageFromWorker()", &script_result)); | 493 ASSERT_TRUE(RunScript("GetMessageFromWorker()", &script_result)); |
495 EXPECT_EQ("action_button_click actionId1", script_result); | 494 EXPECT_EQ("action_button_click actionId1", script_result); |
496 | 495 |
497 notification.delegate()->ButtonClick(1); | 496 notification.delegate()->ButtonClick(1); |
498 ASSERT_TRUE(RunScript("GetMessageFromWorker()", &script_result)); | 497 ASSERT_TRUE(RunScript("GetMessageFromWorker()", &script_result)); |
499 EXPECT_EQ("action_button_click actionId2", script_result); | 498 EXPECT_EQ("action_button_click actionId2", script_result); |
500 } | 499 } |
OLD | NEW |