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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "apps/launcher.h"
6 #include "base/memory/ptr_util.h"
7 #include "base/path_service.h"
8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/common/chrome_paths.h"
10 #include "extensions/common/manifest_handlers/action_handlers_handler.h"
11 #include "extensions/test/extension_test_message_listener.h"
12
13 namespace app_runtime = extensions::api::app_runtime;
14
15 using ActionHandlersBrowserTest = ExtensionApiTest;
16
17 IN_PROC_BROWSER_TEST_F(ActionHandlersBrowserTest, LaunchAppWithNewNote) {
18 // Load the app. Make sure to wait until it is done loading.
19 ExtensionTestMessageListener loader("loaded", false);
20 base::FilePath path =
21 test_data_dir_.AppendASCII("action_handlers").AppendASCII("new_note");
22 const extensions::Extension* app = LoadExtension(path);
23 ASSERT_TRUE(app);
24 EXPECT_TRUE(extensions::ActionHandlersInfo::HasActionHandler(
25 app, app_runtime::ACTION_TYPE_NEW_NOTE));
26 loader.WaitUntilSatisfied();
27
28 // Fire a "new_note" action type, assert that app has received it.
29 ExtensionTestMessageListener new_note("hasNewNote = true", false);
30 auto action_data = base::MakeUnique<app_runtime::ActionData>();
31 action_data->action_type = app_runtime::ActionType::ACTION_TYPE_NEW_NOTE;
32 apps::LaunchPlatformAppWithAction(profile(), app, std::move(action_data),
33 base::FilePath());
34 new_note.WaitUntilSatisfied();
35 }
OLDNEW
« 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