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

Side by Side Diff: chrome/test/data/extensions/api_test/activity_log_private/README

Issue 19014003: Modifications to activity logging end to end tests. Reduces the number of window.open calls to make… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased with other changes Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/activity_log_private/friend/options.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 This directory contains tests for chrome extension activity logging. 1 This directory contains tests for chrome extension activity logging.
2 2
3 The tests use two chrome extensions: 3 The tests use two chrome extensions:
4 -test : sends messages to the friend extension and listens for activity 4 -test : sends messages to the friend extension and listens for activity
5 logged by the friend extension. Checks the activity has been logged 5 logged by the friend extension. Checks the activity has been logged
6 correctly. 6 correctly.
7 -friend: recieves messages from the extension and runs a function based on 7 -friend: recieves messages from the extension and runs a function based on
8 the contents of the message. 8 the contents of the message.
9 9
10 10
11 Adding a new test: 11 Adding a new test:
12 12
13 In friend/reply.js: 13 In friend/reply.js:
14 (1) Add a function to call the chrome api calls you want to test. 14 (1) Add a function to call the chrome api calls you want to test. If you
15 NOTE: The function should clean up any changes it made (e.g. listeners 15 need to use window.open please consider adding your code to
16 executeApiCallsOnTabUpdated or executeDOMChangesOnTabUpdated. Every
17 extra window.open call will slow down the tests by 3s and may cause
18 timeouts.
19 (2) Add the name of the new function to the function map (fnMap).
20
21 IMPORTANT NOTES for adding tests:
22 - The function should clean up any changes it made (e.g. listeners
16 it added) before finishing. If they are not cleaned up then unexpected 23 it added) before finishing. If they are not cleaned up then unexpected
17 behavior can happen in test cases that run after this function. 24 behavior can happen in test cases that run after this function.
18 (2) Add the name of the new function to the function map (fnMap). 25 - Every window.open call can add 3 secs to the test run for debug builds.
26 Making lots of window.open calls will therefore cause the tests to
27 timeout. If your test needs to use window.open please consider adding
28 it to one of the following existing functions:
29 - executeApiCallsOnTabUpdated
30 - executeDOMChangesOnTabUpdated
19 31
20 In friend/options.html: 32 In friend/options.html:
21 (1) Add a button to allow the new function to be called in manual mode. 33 (1) Add a button to allow the new function to be called in manual mode.
22 34
23 You may need also to modify the manifest.json and other files in the 35 You may need also to modify the manifest.json and other files in the
24 friend extension directory. 36 friend extension directory.
25 37
26 In test/test.js: 38 In test/test.js:
27 (1) Add the test to the testcase array. 39 (1) Add the test to the testcase array.
28 40
(...skipping 18 matching lines...) Expand all
47 > out/Debug/browser_tests --gtest_filter=ActivityLogApiTest.TriggerEvent 59 > out/Debug/browser_tests --gtest_filter=ActivityLogApiTest.TriggerEvent
48 60
49 61
50 Running in manual mode: 62 Running in manual mode:
51 63
52 (1) Start chrome with out/Debug/chrome 64 (1) Start chrome with out/Debug/chrome
53 (2) Navigate to chrome://extensions 65 (2) Navigate to chrome://extensions
54 (3) Install the friend and test extensions from your chrome src folder 66 (3) Install the friend and test extensions from your chrome src folder
55 (4) Click on the "options" link under the friend extension 67 (4) Click on the "options" link under the friend extension
56 (5) You should see the options page the buttons to run the functions manually 68 (5) You should see the options page the buttons to run the functions manually
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/activity_log_private/friend/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698