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

Unified Diff: webkit/tools/test_shell/test_shell_gtk.cc

Issue 18186: generate test_shell.pak and hook up loading net resources from (Closed)
Patch Set: Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: webkit/tools/test_shell/test_shell_gtk.cc
diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc
index 972256e0e266c9ecef60d2cdd78b2d6ab942b140..f1087a881c2600b5f22aee7ed1c3b9a1c0ffc20d 100644
--- a/webkit/tools/test_shell/test_shell_gtk.cc
+++ b/webkit/tools/test_shell/test_shell_gtk.cc
@@ -11,10 +11,12 @@
#include <signal.h>
#include <unistd.h>
+#include "base/data_pack.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/message_loop.h"
#include "base/path_service.h"
+#include "base/string_piece.h"
#include "base/string_util.h"
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
@@ -616,6 +618,24 @@ void TestShell::ShowStartupDebuggingDialog() {
gtk_widget_destroy(dialog);
}
+// static
+StringPiece TestShell::NetResourceProvider(int key) {
+ static scoped_ptr<base::DataPack> resource_data_pack;
+
+ if (!resource_data_pack.get()) {
+ resource_data_pack.reset(new base::DataPack);
+ FilePath data_path;
+ PathService::Get(base::DIR_EXE, &data_path);
+ data_path = data_path.Append("test_shell.pak");
+ bool success = resource_data_pack->Load(data_path);
+ CHECK(success) << "failed to load test_shell.pak";
+ }
+
+ StringPiece res;
+ resource_data_pack->Get(key, &res);
+ return res;
+}
+
//-----------------------------------------------------------------------------
namespace webkit_glue {

Powered by Google App Engine
This is Rietveld 408576698