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

Unified Diff: chrome/browser/chromeos/extensions/action_handlers/action_handlers_apitest.cc

Issue 2693053002: cros: Add e2e tests for new_note action handler. Flip feature to stable. (Closed)
Patch Set: Address comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/action_handlers/action_handlers_apitest.cc
diff --git a/chrome/browser/chromeos/extensions/action_handlers/action_handlers_apitest.cc b/chrome/browser/chromeos/extensions/action_handlers/action_handlers_apitest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8f765ac7c6da00fd7557fdbf510bca68862648ab
--- /dev/null
+++ b/chrome/browser/chromeos/extensions/action_handlers/action_handlers_apitest.cc
@@ -0,0 +1,35 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "apps/launcher.h"
+#include "base/memory/ptr_util.h"
+#include "base/path_service.h"
+#include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/common/chrome_paths.h"
+#include "extensions/common/manifest_handlers/action_handlers_handler.h"
+#include "extensions/test/extension_test_message_listener.h"
+
+namespace app_runtime = extensions::api::app_runtime;
+
+using ActionHandlersBrowserTest = ExtensionApiTest;
+
+IN_PROC_BROWSER_TEST_F(ActionHandlersBrowserTest, LaunchAppWithNewNote) {
+ // Load the app. Make sure to wait until it is done loading.
+ ExtensionTestMessageListener loader("loaded", false);
+ base::FilePath path =
+ test_data_dir_.AppendASCII("action_handlers").AppendASCII("new_note");
+ const extensions::Extension* app = LoadExtension(path);
+ ASSERT_TRUE(app);
+ EXPECT_TRUE(extensions::ActionHandlersInfo::HasActionHandler(
+ app, app_runtime::ACTION_TYPE_NEW_NOTE));
+ loader.WaitUntilSatisfied();
+
+ // Fire a "new_note" action type, assert that app has received it.
+ ExtensionTestMessageListener new_note("hasNewNote = true", false);
+ auto action_data = base::MakeUnique<app_runtime::ActionData>();
+ action_data->action_type = app_runtime::ActionType::ACTION_TYPE_NEW_NOTE;
+ apps::LaunchPlatformAppWithAction(profile(), app, std::move(action_data),
+ base::FilePath());
+ new_note.WaitUntilSatisfied();
+}
« no previous file with comments | « no previous file | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698