Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 nee d |
|
felt
2013/07/10 21:44:28
re-wrap please
karenlees
2013/07/10 23:55:46
Done.
| |
| 15 NOTE: The function should clean up any changes it made (e.g. listeners | 15 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 cause timeouts . | |
| 18 (2) Add the name of the new function to the function map (fnMap). | |
| 19 | |
| 20 IMPORTANT NOTES for adding tests: | |
| 21 - 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 | 22 it added) before finishing. If they are not cleaned up then unexpected |
| 17 behavior can happen in test cases that run after this function. | 23 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). | 24 - Calling window.open in can use up to 3 secs per call in the debug |
|
felt
2013/07/10 21:44:28
"in can use up" -- I think you a word :)
karenlees
2013/07/10 23:55:46
Done.
| |
| 25 builds. Making lots of window.open calls will therefore cause the tests | |
| 26 to timeout. If your test needs to use window.open please consider | |
| 27 adding it to one of the following existing functions: | |
| 28 - executeApiCallsOnTabUpdated | |
| 29 - executeDOMChangesOnTabUpdated | |
|
felt
2013/07/10 21:44:28
You asked me to check for clarity -- overall, I th
karenlees
2013/07/10 23:55:46
Great. Thanks!
| |
| 19 | 30 |
| 20 In friend/options.html: | 31 In friend/options.html: |
| 21 (1) Add a button to allow the new function to be called in manual mode. | 32 (1) Add a button to allow the new function to be called in manual mode. |
| 22 | 33 |
| 23 You may need also to modify the manifest.json and other files in the | 34 You may need also to modify the manifest.json and other files in the |
| 24 friend extension directory. | 35 friend extension directory. |
| 25 | 36 |
| 26 In test/test.js: | 37 In test/test.js: |
| 27 (1) Add the test to the testcase array. | 38 (1) Add the test to the testcase array. |
| 28 | 39 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 47 > out/Debug/browser_tests --gtest_filter=ActivityLogApiTest.TriggerEvent | 58 > out/Debug/browser_tests --gtest_filter=ActivityLogApiTest.TriggerEvent |
| 48 | 59 |
| 49 | 60 |
| 50 Running in manual mode: | 61 Running in manual mode: |
| 51 | 62 |
| 52 (1) Start chrome with out/Debug/chrome | 63 (1) Start chrome with out/Debug/chrome |
| 53 (2) Navigate to chrome://extensions | 64 (2) Navigate to chrome://extensions |
| 54 (3) Install the friend and test extensions from your chrome src folder | 65 (3) Install the friend and test extensions from your chrome src folder |
| 55 (4) Click on the "options" link under the friend extension | 66 (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 | 67 (5) You should see the options page the buttons to run the functions manually |
| OLD | NEW |