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

Side by Side Diff: chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc

Issue 2379573008: Add SetImageData api to chrome.clipboard. (Closed)
Patch Set: Address code review comments and add test cases. Created 4 years 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
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 #include "extensions/test/extension_test_message_listener.h" 6 #include "extensions/test/extension_test_message_listener.h"
7 7
8 namespace { 8 namespace {
9 9
10 class ClipboardExtensionApiTest : public ExtensionApiTest {}; 10 class ClipboardExtensionApiTest : public ExtensionApiTest {};
11 11
12 } // namespace 12 } // namespace
13 13
14 IN_PROC_BROWSER_TEST_F(ClipboardExtensionApiTest, ClipboardDataChanged) { 14 IN_PROC_BROWSER_TEST_F(ClipboardExtensionApiTest, ClipboardDataChanged) {
15 ExtensionTestMessageListener result_listener("success 2", false); 15 ExtensionTestMessageListener result_listener("success 2", false);
16 ASSERT_TRUE(RunPlatformAppTest("clipboard/clipboard_data_changed")) 16 ASSERT_TRUE(RunPlatformAppTest("clipboard/clipboard_data_changed"))
17 << message_; 17 << message_;
18 ASSERT_TRUE(result_listener.WaitUntilSatisfied()); 18 ASSERT_TRUE(result_listener.WaitUntilSatisfied());
19 } 19 }
20
21 IN_PROC_BROWSER_TEST_F(ClipboardExtensionApiTest, SetImageData) {
Devlin 2016/12/09 15:23:43 What's the reason this can't be a unittest?
jennyz 2016/12/14 01:15:35 I made ClipboardExtensionApiTest into a interactiv
Devlin 2016/12/16 02:26:15 If it can, let's make it a unit test. Unit tests
jennyz 2016/12/19 07:01:36 I am not familiar with writing unit test for exten
jennyz 2016/12/20 22:16:54 I took a look at converting it to a unit test, it
22 ASSERT_TRUE(StartEmbeddedTestServer());
23 ExtensionTestMessageListener test_listener("test success 3", false);
24 ExtensionTestMessageListener clipboard_change_listener(
25 "clipboard data changed 2", false);
26 ASSERT_TRUE(RunPlatformAppTest("clipboard/set_image_data"))
27 << message_;
28 ASSERT_TRUE(test_listener.WaitUntilSatisfied());
29 ASSERT_TRUE(clipboard_change_listener.WaitUntilSatisfied());
30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698