701d79d08a
console.context(name:string) method returns console instance, this console instance fully implements console interface (including fact that any method can be called without console as receiver). Protocol.Runtime.consoleAPICalled notification contains additional context:string field: - "anonymous#unique-id" for any method call on unnamed console context, - "name#unique-id" for any method call on named console context. console.count and console.timeEnd have context as a scope. console.clear clear all messages regardless on what context instance it was called. console calls is ~10% slower with this CL since we need to store and then fetch console_context_id and console_context_name from function object. We recently (in April) made console calls twice faster so 10% doesn't sound critical and existing of console.log call in hot code is problem by itself. R=pfeldman@chromium.org Bug: chromium:728767 Change-Id: I5fc73216fb8b28bfe1e8c2c1b393ebfbe43cd02e Reviewed-on: https://chromium-review.googlesource.com/522128 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Cr-Commit-Position: refs/heads/master@{#45864}
84 lines
1.3 KiB
Plaintext
84 lines
1.3 KiB
Plaintext
Tests console.context
|
|
|
|
Running test: testConsoleContextMethod
|
|
console.context description:
|
|
{
|
|
className : Function
|
|
description : function context() { [native code] }
|
|
objectId : <objectId>
|
|
type : function
|
|
}
|
|
console.context() methods:
|
|
[
|
|
[0] : debug
|
|
[1] : error
|
|
[2] : info
|
|
[3] : log
|
|
[4] : warn
|
|
[5] : dir
|
|
[6] : dirXml
|
|
[7] : table
|
|
[8] : trace
|
|
[9] : group
|
|
[10] : groupCollapsed
|
|
[11] : groupEnd
|
|
[12] : clear
|
|
[13] : count
|
|
[14] : assert
|
|
[15] : markTimeline
|
|
[16] : profile
|
|
[17] : profileEnd
|
|
[18] : timeline
|
|
[19] : timelineEnd
|
|
[20] : time
|
|
[21] : timeEnd
|
|
[22] : timeStamp
|
|
]
|
|
|
|
Running test: testDefaultConsoleContext
|
|
undefined
|
|
undefined
|
|
undefined
|
|
|
|
Running test: testAnonymousConsoleContext
|
|
anonymous#2
|
|
anonymous#3
|
|
anonymous#4
|
|
|
|
Running test: testNamedConsoleContext
|
|
named-context#6
|
|
named-context#6
|
|
named-context#6
|
|
|
|
Running test: testTwoConsoleContextsWithTheSameName
|
|
named-context#7
|
|
named-context#8
|
|
|
|
Running test: testConsoleCountInDifferentConsoleContexts
|
|
[
|
|
[0] : {
|
|
type : string
|
|
value : 239: 1
|
|
}
|
|
]
|
|
[
|
|
[0] : {
|
|
type : string
|
|
value : 239: 1
|
|
}
|
|
]
|
|
|
|
Running test: testConsoleCountForNamedConsoleContext
|
|
[
|
|
[0] : {
|
|
type : string
|
|
value : 239: 1
|
|
}
|
|
]
|
|
[
|
|
[0] : {
|
|
type : string
|
|
value : 239: 2
|
|
}
|
|
]
|