diff options
| author | Stephen Blott | 2016-04-18 11:43:53 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2016-04-18 12:20:32 +0100 | 
| commit | 247878a7919c5e9b27638395d479939f9ad5d22e (patch) | |
| tree | 0416c617b5949a7b3c89938036ee735c222576b9 /tests/unit_tests | |
| parent | dd07ffaa15efc6dff138cdaf89a146f229cc5b9d (diff) | |
| download | vimium-247878a7919c5e9b27638395d479939f9ad5d22e.tar.bz2 | |
Cache content_scripts/vimium.css in chrome.storage.local.
Previously, we had two different approaches.  This seems like a simpler
approach.
We simply cache the Vimium CSS in chrome.storage.local (in the
background page) and fetch it from there (in UI components).
There is also a minor change in the we no longer cache the CSS in
memory.  This seems to be the right thing to do.  Caching the CSS in
memory consumes a small amount of memory.  However, it can only speed up
the fastest loads.  It cannot speed up the first load -- which is likely
the one that matters most.  So caching the CSS in memory seems to make
little sense.
Diffstat (limited to 'tests/unit_tests')
| -rw-r--r-- | tests/unit_tests/test_chrome_stubs.coffee | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/tests/unit_tests/test_chrome_stubs.coffee b/tests/unit_tests/test_chrome_stubs.coffee index 702ea77f..bea13df3 100644 --- a/tests/unit_tests/test_chrome_stubs.coffee +++ b/tests/unit_tests/test_chrome_stubs.coffee @@ -15,6 +15,12 @@ global.document =    createElement: -> {}    addEventListener: -> +global.XMLHttpRequest = +  class XMLHttpRequest +    open: -> +    onload: -> +    send: -> +  exports.chrome =    areRunningVimiumTests: true | 
