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

Unified Diff: test/inspector/task-runner.h

Issue 2663743002: [inspector] added test infrastructure and test for es6 modules (Closed)
Patch Set: addressed comment Created 3 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
« no previous file with comments | « test/inspector/runtime/es6-module-expected.txt ('k') | test/inspector/task-runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/task-runner.h
diff --git a/test/inspector/task-runner.h b/test/inspector/task-runner.h
index 045bba0d259513ec9e36f891ff083723808817e0..0f980fbfaa1e2eab842e50738bdf4c639d016d2e 100644
--- a/test/inspector/task-runner.h
+++ b/test/inspector/task-runner.h
@@ -5,6 +5,8 @@
#ifndef V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_
#define V8_TEST_INSPECTOR_PROTOCOL_TASK_RUNNER_H_
+#include <map>
+
#include "include/v8-inspector.h"
#include "include/v8-platform.h"
#include "include/v8.h"
@@ -14,6 +16,16 @@
#include "src/locked-queue-inl.h"
#include "src/vector.h"
+struct VectorCompare {
+ bool operator()(const v8::internal::Vector<uint16_t>& lhs,
+ const v8::internal::Vector<uint16_t>& rhs) const {
+ for (int i = 0; i < lhs.length() && i < rhs.length(); ++i) {
+ if (lhs[i] != rhs[i]) return lhs[i] < rhs[i];
+ }
+ return false;
+ }
+};
+
class TaskRunner : public v8::base::Thread {
public:
class Task {
@@ -42,6 +54,12 @@ class TaskRunner : public v8::base::Thread {
void Terminate();
+ void RegisterModule(v8::internal::Vector<uint16_t> name,
+ v8::Local<v8::Module> module);
+ static v8::MaybeLocal<v8::Module> ModuleResolveCallback(
+ v8::Local<v8::Context> context, v8::Local<v8::String> specifier,
+ v8::Local<v8::Module> referrer);
+
private:
void InitializeContext();
Task* GetNext(bool only_protocol);
@@ -60,6 +78,10 @@ class TaskRunner : public v8::base::Thread {
v8::internal::LockedQueue<Task*> deffered_queue_;
v8::base::Semaphore process_queue_semaphore_;
+ std::map<v8::internal::Vector<uint16_t>, v8::Global<v8::Module>,
+ VectorCompare>
+ modules_;
+
int nested_loop_count_;
v8::base::AtomicNumber<int> is_terminated_;
@@ -86,7 +108,8 @@ class ExecuteStringTask : public AsyncTask {
ExecuteStringTask(const v8::internal::Vector<uint16_t>& expression,
v8::Local<v8::String> name,
v8::Local<v8::Integer> line_offset,
- v8::Local<v8::Integer> column_offset, const char* task_name,
+ v8::Local<v8::Integer> column_offset,
+ v8::Local<v8::Boolean> is_module, const char* task_name,
v8_inspector::V8Inspector* inspector);
explicit ExecuteStringTask(
const v8::internal::Vector<const char>& expression);
@@ -99,8 +122,9 @@ class ExecuteStringTask : public AsyncTask {
v8::internal::Vector<uint16_t> expression_;
v8::internal::Vector<const char> expression_utf8_;
v8::internal::Vector<uint16_t> name_;
- int32_t line_offset_;
- int32_t column_offset_;
+ int32_t line_offset_ = 0;
+ int32_t column_offset_ = 0;
+ bool is_module_ = false;
DISALLOW_COPY_AND_ASSIGN(ExecuteStringTask);
};
« no previous file with comments | « test/inspector/runtime/es6-module-expected.txt ('k') | test/inspector/task-runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698