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

Unified Diff: test/inspector/inspector-test.cc

Issue 2836623002: [inspector] always include user scripts in the snapshot. (Closed)
Patch Set: rebase Created 3 years, 8 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
« no previous file with comments | « test/inspector/debugger/step-snapshot-expected.txt ('k') | test/inspector/task-runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/inspector-test.cc
diff --git a/test/inspector/inspector-test.cc b/test/inspector/inspector-test.cc
index 0d19b8d82d2f14a78fa61a31d0c4eb1bc0eb964e..6c6eb316c28d30af0141b68cc691c62f2d083b51 100644
--- a/test/inspector/inspector-test.cc
+++ b/test/inspector/inspector-test.cc
@@ -589,11 +589,22 @@ int main(int argc, char* argv[]) {
v8::base::Semaphore ready_semaphore(0);
+ v8::StartupData startup_data = {nullptr, 0};
+ for (int i = 1; i < argc; ++i) {
+ if (strcmp(argv[i], "--embed") == 0) {
+ argv[i++] = nullptr;
+ printf("Embedding script '%s'\n", argv[i]);
+ startup_data = v8::V8::CreateSnapshotDataBlob(argv[i]);
+ argv[i] = nullptr;
+ }
+ }
+
TaskRunner::SetupGlobalTasks backend_extensions;
backend_extensions.emplace_back(new SetTimeoutExtension());
backend_extensions.emplace_back(new InspectorExtension());
TaskRunner backend_runner(std::move(backend_extensions), false,
- &ready_semaphore);
+ &ready_semaphore,
+ startup_data.data ? &startup_data : nullptr);
ready_semaphore.Wait();
SendMessageToBackendExtension::set_backend_task_runner(&backend_runner);
UtilsExtension::set_backend_task_runner(&backend_runner);
@@ -602,7 +613,7 @@ int main(int argc, char* argv[]) {
frontend_extensions.emplace_back(new UtilsExtension());
frontend_extensions.emplace_back(new SendMessageToBackendExtension());
TaskRunner frontend_runner(std::move(frontend_extensions), true,
- &ready_semaphore);
+ &ready_semaphore, nullptr);
ready_semaphore.Wait();
FrontendChannelImpl frontend_channel(&frontend_runner);
@@ -616,7 +627,7 @@ int main(int argc, char* argv[]) {
for (int i = 1; i < argc; ++i) {
// Ignore unknown flags.
- if (argv[i][0] == '-') continue;
+ if (argv[i] == nullptr || argv[i][0] == '-') continue;
bool exists = false;
v8::internal::Vector<const char> chars =
@@ -631,5 +642,7 @@ int main(int argc, char* argv[]) {
frontend_runner.Join();
backend_runner.Join();
+
+ delete startup_data.data;
return 0;
}
« no previous file with comments | « test/inspector/debugger/step-snapshot-expected.txt ('k') | test/inspector/task-runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698