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

Side by Side Diff: chrome/test/data/extensions/api_test/save_page/test.js

Issue 8530003: Delete the temporary file when generating MHTML with the extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor clean-ups Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // API test for chrome.extension.savePage. 5 // API test for chrome.extension.savePage.
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.SavePage 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.SavePage
7 7
8 const assertEq = chrome.test.assertEq; 8 const assertEq = chrome.test.assertEq;
9 const assertTrue = chrome.test.assertTrue; 9 const assertTrue = chrome.test.assertTrue;
10 10
(...skipping 22 matching lines...) Expand all
33 assertEq(undefined, chrome.extension.lastError); 33 assertEq(undefined, chrome.extension.lastError);
34 assertTrue(data != null); 34 assertTrue(data != null);
35 // It should contain few KBs of data. 35 // It should contain few KBs of data.
36 assertTrue(data.size > 100); 36 assertTrue(data.size > 100);
37 // Let's make sure it contains some well known strings. 37 // Let's make sure it contains some well known strings.
38 var reader = new FileReader(); 38 var reader = new FileReader();
39 reader.onload = function(e) { 39 reader.onload = function(e) {
40 var text = e.target.result; 40 var text = e.target.result;
41 assertTrue(text.indexOf(testUrl) != -1); 41 assertTrue(text.indexOf(testUrl) != -1);
42 assertTrue(text.indexOf("logo.png") != -1); 42 assertTrue(text.indexOf("logo.png") != -1);
43 chrome.test.notifyPass(); 43 // Run the GC so the blob is deleted.
44 window.setTimeout(function() { window.gc(); });
45 window.setTimeout(function() { chrome.test.notifyPass(); }, 0);
44 }; 46 };
45 reader.readAsText(data); 47 reader.readAsText(data);
46 }); 48 });
47 }); 49 });
48 }); 50 });
49 } 51 }
50 ]); 52 ]);
51 }); 53 });
52 54
OLDNEW
« chrome/test/base/ui_test_utils.cc ('K') | « chrome/test/base/ui_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698