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

Unified Diff: chrome/test/data/extensions/api_test/save_page/test.js

Issue 8682013: Moving the MHTML API out of experimental and renaming it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One more sync 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/save_page/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/save_page/test.js
diff --git a/chrome/test/data/extensions/api_test/save_page/test.js b/chrome/test/data/extensions/api_test/save_page/test.js
deleted file mode 100644
index b19121fbecf1094d64886d3253e04c5c4f043b0d..0000000000000000000000000000000000000000
--- a/chrome/test/data/extensions/api_test/save_page/test.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// API test for chrome.extension.savePage.
-// browser_tests.exe --gtest_filter=ExtensionApiTest.SavePage
-
-const assertEq = chrome.test.assertEq;
-const assertTrue = chrome.test.assertTrue;
-
-var testUrl = 'http://www.a.com:PORT' +
- '/files/extensions/api_test/save_page/google.html';
-
-function waitForCurrentTabLoaded(callback) {
- chrome.tabs.getSelected(null, function(tab) {
- if (tab.status == "complete" && tab.url == testUrl) {
- callback();
- return;
- }
- window.setTimeout(function() { waitForCurrentTabLoaded(callback); }, 100);
- });
-}
-
-chrome.test.getConfig(function(config) {
- testUrl = testUrl.replace(/PORT/, config.testServer.port);
-
- chrome.test.runTests([
- function savePageAsMHTML() {
- chrome.tabs.getSelected(null, function(tab) {
- chrome.tabs.update(null, { "url": testUrl });
- waitForCurrentTabLoaded(function() {
- chrome.experimental.savePage.saveAsMHTML({ "tabId": tab.id },
- function(data) {
- assertEq(undefined, chrome.extension.lastError);
- assertTrue(data != null);
- // It should contain few KBs of data.
- assertTrue(data.size > 100);
- // Let's make sure it contains some well known strings.
- var reader = new FileReader();
- reader.onload = function(e) {
- var text = e.target.result;
- assertTrue(text.indexOf(testUrl) != -1);
- assertTrue(text.indexOf("logo.png") != -1);
- // Run the GC so the blob is deleted.
- window.setTimeout(function() { window.gc(); });
- window.setTimeout(function() { chrome.test.notifyPass(); }, 0);
- };
- reader.readAsText(data);
- });
- });
- });
- }
- ]);
-});
-
« no previous file with comments | « chrome/test/data/extensions/api_test/save_page/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698